[REQ] Implement needed common isX properties in java Schema classes in openapi core
Created by: spacether
Is your feature request related to a problem? Please describe.
The openapi generator core java java classes that implement Schema lack all the same kind of isX properties. One would expect to see:
- isString
- isDate
- isDateTime
- isFloat
- isInteger
- isDouble
- isNumber
- isLong
- isBinary
- isMap
- isArray
- isAnyType
- isNull
- hasValidation
- required
- hasValidation
- not
- discriminator
In these classes:
- CodegenProperty
- CodegenModel
- CodegenParameter
- CodegenResponse
But these properties are not alway present or are inconsistently named:
- [FIXED] isDate : not present in CodegenModel
- [FIXED] isDateTime: not present in CodegenModel
- [FIXED] isAnyType: not present in CodegenModel
- [FIXED] isMap: inconsistently named
- [FIXED] isArray: inconsistently named
- [ADDED] isNull: missing
- [FIXED] hasValidation: validations missing from some instances, like object with minProperties
We may be using different names for the same concepts for CodegenResponse: returnType/returnBaseType or dataType/baseType CodegenProperty: complexType/dataType CodegenParameter: dataType/baseType
Describe the solution you'd like
Please add those properties to all of those classes. One clear way to do this would be to implement getter and setter interfaces in IJsonSchemaValidationProperties which is turning into a Schema interface.
Describe alternatives you've considered
- just add the properties as public properties in all classes
- add getter and setter methods in IJsonSchemaValidationProperties and add properties into the classes
- I prefer this option because the interface indicates that these are required
Additional context
This topic came up when I was working on https://github.com/OpenAPITools/openapi-generator/issues/7613