[REQ] Add `isDeprecated` field to schema object.
Created by: yuji38kwmt
Is your feature request related to a problem? Please describe.
I created the following yaml file that tag
field of Pet
Object is deprecated.
I executed generate
command with -DdebugModels
option and I printed JSON model.
But json model does not include isDeprecated
field.
So I can not use isDrecated
variable in model.mustache
file.
petstore.yaml
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets/{petId}:
get:
summary: Info for a specific pet
operationId: showPetById
tags:
- pets
parameters:
- name: petId
in: path
required: true
description: The id of the pet to retrieve
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Pet"
components:
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
deprecated: true
Executed command
$ java -Dmodels -DmodelTests=false -DmodelDocs=false -DdebugModels \
-jar openapi-generator-cli-4.0.3.jar generate \
-g python -i petstore.yaml
-DdebugModels
option
JSON model with {
"openApiType" : "string",
"baseName" : "tag",
"getter" : "getTag",
"setter" : "setTag",
"dataType" : "str",
"datatypeWithEnum" : "str",
"name" : "tag",
"defaultValueWithParam" : " = data.tag;",
"baseType" : "str",
"example" : "null",
"jsonSchema" : "{\n \"type\" : \"string\",\n \"deprecated\" : true\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : false,
"required" : false,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isContainer" : false,
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isInherited" : false,
"nameInCamelCase" : "Tag",
"nameInSnakeCase" : "TAG",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"iexclusiveMaximum" : false,
"datatype" : "str"
}
Describe the solution you'd like
Add isDeprecated
field to schema object.
Additional context
isDeprecated
variable is available in api.mustache
file.