forked from com2ghz/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate deprecated property through $ref's (OpenAPITools#6093)
* Propagate deprecated property through $ref's As $ref is supposed to completely replace the definition of a property, make sure we also include the 'deprecated' property when generating the type of a $ref property. This makes a property $ref'ing a deprecated schema also become deprecated. * Clarify why we're messing around with $ref
- Loading branch information
1 parent
302d028
commit dca2370
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
modules/openapi-generator/src/test/resources/3_0/model-deprecated.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
openapi: 3.0.1 | ||
info: | ||
version: 1.0.0 | ||
title: Example | ||
license: | ||
name: MIT | ||
servers: | ||
- url: http://api.example.xyz/v1 | ||
|
||
components: | ||
schemas: | ||
deprecated: | ||
type: object | ||
deprecated: true | ||
properties: | ||
customerCode: | ||
type: string | ||
example: '0001' | ||
firstName: | ||
type: string | ||
example: 'first' | ||
current: | ||
type: object | ||
properties: | ||
customerCode: | ||
type: string | ||
example: '0001' | ||
firstName: | ||
type: string | ||
example: 'first' | ||
complex: | ||
properties: | ||
deprecated: | ||
$ref: "#/components/schemas/deprecated" | ||
current: | ||
type: boolean |