Skip to content

[REQ] Implement needed common isX properties in java Schema classes in openapi core #7651

Closed
@spacether

Description

@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

  1. just add the properties as public properties in all classes
  2. 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 #7613

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions