forked from loafle/openapi-generator-original
[Java][*] Annotate deprecated operations and schemas (#9478)
Refs #3358 Ensure `deprecated` operations are annotated/documented as such on the generated methods. Libraries updated: * [feign] * [google-api-client] * [microprofile] * [okhttp-gson] * [resttemplate] * [retrofit] * [retrofit/play*] * [webclient] * [vertx] Ensure `deprecated` schemas are annotated/documented as such on the generated classes/fields. Libraries updated: * [feign] * [google-api-client] * [jersey2] * [microprofile] * [native] * [okhttp-gson] * [rest-assured] * [resteasy] * [resttemplate] * [retrofit*] * [webclient] * [vertx] Also fix two minor bugs to get the java sample tests working: * Fix an invalid jackson-datatype-threetenbp version number in vertx/pom.mustache * Fix a bad return type in webclient/api_test.mustache when uniqueItems=true Since this commit updates petstore-with-fake-endpoints-models-for-testing.yaml, several other samples were updated, but it's just new files to reflect the deprecated schemas, so there should be no consequential differences. Relevant bits of the spec: * https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-operationdeprecated * https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-schemadeprecated
This commit is contained in:
@@ -25,6 +25,7 @@ import CatAllOf from './model/CatAllOf';
|
||||
import Category from './model/Category';
|
||||
import ClassModel from './model/ClassModel';
|
||||
import Client from './model/Client';
|
||||
import DeprecatedObject from './model/DeprecatedObject';
|
||||
import Dog from './model/Dog';
|
||||
import DogAllOf from './model/DogAllOf';
|
||||
import EnumArrays from './model/EnumArrays';
|
||||
@@ -44,6 +45,7 @@ import Model200Response from './model/Model200Response';
|
||||
import Name from './model/Name';
|
||||
import NullableClass from './model/NullableClass';
|
||||
import NumberOnly from './model/NumberOnly';
|
||||
import ObjectWithDeprecatedFields from './model/ObjectWithDeprecatedFields';
|
||||
import Order from './model/Order';
|
||||
import OuterComposite from './model/OuterComposite';
|
||||
import OuterEnum from './model/OuterEnum';
|
||||
@@ -176,6 +178,12 @@ export {
|
||||
*/
|
||||
Client,
|
||||
|
||||
/**
|
||||
* The DeprecatedObject model constructor.
|
||||
* @property {module:model/DeprecatedObject}
|
||||
*/
|
||||
DeprecatedObject,
|
||||
|
||||
/**
|
||||
* The Dog model constructor.
|
||||
* @property {module:model/Dog}
|
||||
@@ -290,6 +298,12 @@ export {
|
||||
*/
|
||||
NumberOnly,
|
||||
|
||||
/**
|
||||
* The ObjectWithDeprecatedFields model constructor.
|
||||
* @property {module:model/ObjectWithDeprecatedFields}
|
||||
*/
|
||||
ObjectWithDeprecatedFields,
|
||||
|
||||
/**
|
||||
* The Order model constructor.
|
||||
* @property {module:model/Order}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* The DeprecatedObject model module.
|
||||
* @module model/DeprecatedObject
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class DeprecatedObject {
|
||||
/**
|
||||
* Constructs a new <code>DeprecatedObject</code>.
|
||||
* @alias module:model/DeprecatedObject
|
||||
*/
|
||||
constructor() {
|
||||
|
||||
DeprecatedObject.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>DeprecatedObject</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/DeprecatedObject} obj Optional instance to populate.
|
||||
* @return {module:model/DeprecatedObject} The populated <code>DeprecatedObject</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new DeprecatedObject();
|
||||
|
||||
if (data.hasOwnProperty('name')) {
|
||||
obj['name'] = ApiClient.convertToType(data['name'], 'String');
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} name
|
||||
*/
|
||||
DeprecatedObject.prototype['name'] = undefined;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default DeprecatedObject;
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* 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 DeprecatedObject from './DeprecatedObject';
|
||||
|
||||
/**
|
||||
* The ObjectWithDeprecatedFields model module.
|
||||
* @module model/ObjectWithDeprecatedFields
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class ObjectWithDeprecatedFields {
|
||||
/**
|
||||
* Constructs a new <code>ObjectWithDeprecatedFields</code>.
|
||||
* @alias module:model/ObjectWithDeprecatedFields
|
||||
*/
|
||||
constructor() {
|
||||
|
||||
ObjectWithDeprecatedFields.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>ObjectWithDeprecatedFields</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/ObjectWithDeprecatedFields} obj Optional instance to populate.
|
||||
* @return {module:model/ObjectWithDeprecatedFields} The populated <code>ObjectWithDeprecatedFields</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new ObjectWithDeprecatedFields();
|
||||
|
||||
if (data.hasOwnProperty('uuid')) {
|
||||
obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('id')) {
|
||||
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('deprecatedRef')) {
|
||||
obj['deprecatedRef'] = DeprecatedObject.constructFromObject(data['deprecatedRef']);
|
||||
}
|
||||
if (data.hasOwnProperty('bars')) {
|
||||
obj['bars'] = ApiClient.convertToType(data['bars'], ['String']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} uuid
|
||||
*/
|
||||
ObjectWithDeprecatedFields.prototype['uuid'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} id
|
||||
*/
|
||||
ObjectWithDeprecatedFields.prototype['id'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {module:model/DeprecatedObject} deprecatedRef
|
||||
*/
|
||||
ObjectWithDeprecatedFields.prototype['deprecatedRef'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Array.<String>} bars
|
||||
*/
|
||||
ObjectWithDeprecatedFields.prototype['bars'] = undefined;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default ObjectWithDeprecatedFields;
|
||||
|
||||
Reference in New Issue
Block a user