[Inline model resolver] better handling of inline responses and bug fixes (#12353)

* better handling of inline response schemas, bug fixes

* update samples

* add new files

* better code format

* remove unused ruby files

* fix java test

* remove unused js spec files

* remove inline_response_default_test.dart

* fix webclient tests

* fix spring tests
This commit is contained in:
William Cheng
2022-05-13 10:17:59 +08:00
committed by GitHub
parent 2cf3d3805f
commit 12cdacabbf
284 changed files with 7620 additions and 1220 deletions

View File

@@ -27,10 +27,10 @@ docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
docs/Foo.md
docs/FooGetDefaultResponse.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineResponseDefault.md
docs/List.md
docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -88,10 +88,10 @@ src/model/EnumTest.js
src/model/File.js
src/model/FileSchemaTestClass.js
src/model/Foo.js
src/model/FooGetDefaultResponse.js
src/model/FormatTest.js
src/model/HasOnlyReadOnly.js
src/model/HealthCheckResult.js
src/model/InlineResponseDefault.js
src/model/List.js
src/model/MapTest.js
src/model/MixedPropertiesAndAdditionalPropertiesClass.js

View File

@@ -186,10 +186,10 @@ Class | Method | HTTP request | Description
- [OpenApiPetstore.File](docs/File.md)
- [OpenApiPetstore.FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [OpenApiPetstore.Foo](docs/Foo.md)
- [OpenApiPetstore.FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
- [OpenApiPetstore.FormatTest](docs/FormatTest.md)
- [OpenApiPetstore.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [OpenApiPetstore.HealthCheckResult](docs/HealthCheckResult.md)
- [OpenApiPetstore.InlineResponseDefault](docs/InlineResponseDefault.md)
- [OpenApiPetstore.List](docs/List.md)
- [OpenApiPetstore.MapTest](docs/MapTest.md)
- [OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)

View File

@@ -10,7 +10,7 @@ Method | HTTP request | Description
## fooGet
> InlineResponseDefault fooGet()
> FooGetDefaultResponse fooGet()
@@ -35,7 +35,7 @@ This endpoint does not need any parameter.
### Return type
[**InlineResponseDefault**](InlineResponseDefault.md)
[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
### Authorization

View File

@@ -0,0 +1,9 @@
# OpenApiPetstore.FooGetDefaultResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string** | [**Foo**](Foo.md) | | [optional]

View File

@@ -13,7 +13,7 @@
import ApiClient from "../ApiClient";
import InlineResponseDefault from '../model/InlineResponseDefault';
import FooGetDefaultResponse from '../model/FooGetDefaultResponse';
/**
* Default service.
@@ -38,13 +38,13 @@ export default class DefaultApi {
* Callback function to receive the result of the fooGet operation.
* @callback module:api/DefaultApi~fooGetCallback
* @param {String} error Error message, if any.
* @param {module:model/InlineResponseDefault} data The data returned by the service call.
* @param {module:model/FooGetDefaultResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* @param {module:api/DefaultApi~fooGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/InlineResponseDefault}
* data is of type: {@link module:model/FooGetDefaultResponse}
*/
fooGet(callback) {
let postBody = null;
@@ -61,7 +61,7 @@ export default class DefaultApi {
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = InlineResponseDefault;
let returnType = FooGetDefaultResponse;
return this.apiClient.callApi(
'/foo', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,

View File

@@ -34,10 +34,10 @@ import EnumTest from './model/EnumTest';
import File from './model/File';
import FileSchemaTestClass from './model/FileSchemaTestClass';
import Foo from './model/Foo';
import FooGetDefaultResponse from './model/FooGetDefaultResponse';
import FormatTest from './model/FormatTest';
import HasOnlyReadOnly from './model/HasOnlyReadOnly';
import HealthCheckResult from './model/HealthCheckResult';
import InlineResponseDefault from './model/InlineResponseDefault';
import List from './model/List';
import MapTest from './model/MapTest';
import MixedPropertiesAndAdditionalPropertiesClass from './model/MixedPropertiesAndAdditionalPropertiesClass';
@@ -232,6 +232,12 @@ export {
*/
Foo,
/**
* The FooGetDefaultResponse model constructor.
* @property {module:model/FooGetDefaultResponse}
*/
FooGetDefaultResponse,
/**
* The FormatTest model constructor.
* @property {module:model/FormatTest}
@@ -250,12 +256,6 @@ export {
*/
HealthCheckResult,
/**
* The InlineResponseDefault model constructor.
* @property {module:model/InlineResponseDefault}
*/
InlineResponseDefault,
/**
* The List model constructor.
* @property {module:model/List}

View File

@@ -0,0 +1,72 @@
/**
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import Foo from './Foo';
/**
* The FooGetDefaultResponse model module.
* @module model/FooGetDefaultResponse
* @version 1.0.0
*/
class FooGetDefaultResponse {
/**
* Constructs a new <code>FooGetDefaultResponse</code>.
* @alias module:model/FooGetDefaultResponse
*/
constructor() {
FooGetDefaultResponse.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>FooGetDefaultResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/FooGetDefaultResponse} obj Optional instance to populate.
* @return {module:model/FooGetDefaultResponse} The populated <code>FooGetDefaultResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new FooGetDefaultResponse();
if (data.hasOwnProperty('string')) {
obj['string'] = Foo.constructFromObject(data['string']);
}
}
return obj;
}
}
/**
* @member {module:model/Foo} string
*/
FooGetDefaultResponse.prototype['string'] = undefined;
export default FooGetDefaultResponse;

View File

@@ -28,7 +28,7 @@
var instance;
beforeEach(function() {
instance = new OpenApiPetstore.InlineResponseDefault();
instance = new OpenApiPetstore.FooGetDefaultResponse();
});
var getProperty = function(object, getter, property) {
@@ -47,16 +47,16 @@
object[property] = value;
}
describe('InlineResponseDefault', function() {
it('should create an instance of InlineResponseDefault', function() {
// uncomment below and update the code to test InlineResponseDefault
//var instane = new OpenApiPetstore.InlineResponseDefault();
//expect(instance).to.be.a(OpenApiPetstore.InlineResponseDefault);
describe('FooGetDefaultResponse', function() {
it('should create an instance of FooGetDefaultResponse', function() {
// uncomment below and update the code to test FooGetDefaultResponse
//var instance = new OpenApiPetstore.FooGetDefaultResponse();
//expect(instance).to.be.a(OpenApiPetstore.FooGetDefaultResponse);
});
it('should have the property _string (base name: "string")', function() {
// uncomment below and update the code to test the property _string
//var instance = new OpenApiPetstore.InlineResponseDefault();
it('should have the property string (base name: "string")', function() {
// uncomment below and update the code to test the property string
//var instance = new OpenApiPetstore.FooGetDefaultResponse();
//expect(instance).to.be();
});