Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ namespace {{packageName}}.Test.{{apiPackage}}
{{#dataType}}
var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
var model = response.{{vendorExtensions.x-http-status}}();
{{#isModel}}
Assert.IsType<{{packageName}}.{{modelPackage}}.{{{.}}}>(model);
{{/isModel}}
{{^isModel}}
Assert.IsType<{{{.}}}>(model);
{{/isModel}}
{{/dataType}}
{{^dataType}}
await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
openapi: 3.0.0
info:
title: Model Name Collision Test
description: >-
Tests that generated test code uses fully-qualified type names for model
return types to avoid collisions with standard library classes (e.g. a
model named "Attributes" would conflict with System.Attribute).
version: 1.0.0
license:
name: Apache-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
paths:
/resources:
get:
operationId: GetResources
tags:
- Resources
responses:
'200':
description: Returns a resource with attributes
content:
application/json:
schema:
$ref: '#/components/schemas/Attributes'
servers:
- url: 'http://localhost'
components:
schemas:
Attributes:
type: object
properties:
id:
type: integer
format: int32
name:
type: string
Loading