[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:
Jon Jensen
2021-07-18 20:27:03 -06:00
committed by GitHub
parent c42e03e251
commit bd070308d9
2116 changed files with 229574 additions and 578 deletions

View File

@@ -16,6 +16,7 @@ docs/Category.md
docs/ClassModel.md
docs/Client.md
docs/DefaultApi.md
docs/DeprecatedObject.md
docs/Dog.md
docs/DogAllOf.md
docs/EnumArrays.md
@@ -37,6 +38,7 @@ docs/Model200Response.md
docs/Name.md
docs/NullableClass.md
docs/NumberOnly.md
docs/ObjectWithDeprecatedFields.md
docs/Order.md
docs/OuterComposite.md
docs/OuterEnum.md
@@ -77,6 +79,7 @@ src/model/CatAllOf.js
src/model/Category.js
src/model/ClassModel.js
src/model/Client.js
src/model/DeprecatedObject.js
src/model/Dog.js
src/model/DogAllOf.js
src/model/EnumArrays.js
@@ -96,6 +99,7 @@ src/model/Model200Response.js
src/model/Name.js
src/model/NullableClass.js
src/model/NumberOnly.js
src/model/ObjectWithDeprecatedFields.js
src/model/Order.js
src/model/OuterComposite.js
src/model/OuterEnum.js

View File

@@ -177,6 +177,7 @@ Class | Method | HTTP request | Description
- [OpenApiPetstore.Category](docs/Category.md)
- [OpenApiPetstore.ClassModel](docs/ClassModel.md)
- [OpenApiPetstore.Client](docs/Client.md)
- [OpenApiPetstore.DeprecatedObject](docs/DeprecatedObject.md)
- [OpenApiPetstore.Dog](docs/Dog.md)
- [OpenApiPetstore.DogAllOf](docs/DogAllOf.md)
- [OpenApiPetstore.EnumArrays](docs/EnumArrays.md)
@@ -196,6 +197,7 @@ Class | Method | HTTP request | Description
- [OpenApiPetstore.Name](docs/Name.md)
- [OpenApiPetstore.NullableClass](docs/NullableClass.md)
- [OpenApiPetstore.NumberOnly](docs/NumberOnly.md)
- [OpenApiPetstore.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
- [OpenApiPetstore.Order](docs/Order.md)
- [OpenApiPetstore.OuterComposite](docs/OuterComposite.md)
- [OpenApiPetstore.OuterEnum](docs/OuterEnum.md)

View File

@@ -0,0 +1,9 @@
# OpenApiPetstore.DeprecatedObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]

View File

@@ -0,0 +1,12 @@
# OpenApiPetstore.ObjectWithDeprecatedFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **String** | | [optional]
**id** | **Number** | | [optional]
**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
**bars** | **[String]** | | [optional]

View File

@@ -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}

View File

@@ -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;

View File

@@ -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;

View File

@@ -0,0 +1,65 @@
/**
* 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.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.OpenApiPetstore);
}
}(this, function(expect, OpenApiPetstore) {
'use strict';
var instance;
beforeEach(function() {
instance = new OpenApiPetstore.DeprecatedObject();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('DeprecatedObject', function() {
it('should create an instance of DeprecatedObject', function() {
// uncomment below and update the code to test DeprecatedObject
//var instane = new OpenApiPetstore.DeprecatedObject();
//expect(instance).to.be.a(OpenApiPetstore.DeprecatedObject);
});
it('should have the property name (base name: "name")', function() {
// uncomment below and update the code to test the property name
//var instance = new OpenApiPetstore.DeprecatedObject();
//expect(instance).to.be();
});
});
}));

View File

@@ -0,0 +1,83 @@
/**
* 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.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.OpenApiPetstore);
}
}(this, function(expect, OpenApiPetstore) {
'use strict';
var instance;
beforeEach(function() {
instance = new OpenApiPetstore.ObjectWithDeprecatedFields();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('ObjectWithDeprecatedFields', function() {
it('should create an instance of ObjectWithDeprecatedFields', function() {
// uncomment below and update the code to test ObjectWithDeprecatedFields
//var instane = new OpenApiPetstore.ObjectWithDeprecatedFields();
//expect(instance).to.be.a(OpenApiPetstore.ObjectWithDeprecatedFields);
});
it('should have the property uuid (base name: "uuid")', function() {
// uncomment below and update the code to test the property uuid
//var instance = new OpenApiPetstore.ObjectWithDeprecatedFields();
//expect(instance).to.be();
});
it('should have the property id (base name: "id")', function() {
// uncomment below and update the code to test the property id
//var instance = new OpenApiPetstore.ObjectWithDeprecatedFields();
//expect(instance).to.be();
});
it('should have the property deprecatedRef (base name: "deprecatedRef")', function() {
// uncomment below and update the code to test the property deprecatedRef
//var instance = new OpenApiPetstore.ObjectWithDeprecatedFields();
//expect(instance).to.be();
});
it('should have the property bars (base name: "bars")', function() {
// uncomment below and update the code to test the property bars
//var instance = new OpenApiPetstore.ObjectWithDeprecatedFields();
//expect(instance).to.be();
});
});
}));