Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7651
Closed
Open
Issue created Oct 11, 2020 by Administrator@rootContributor

[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

  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 https://github.com/OpenAPITools/openapi-generator/issues/7613

Assignee
Assign to
Time tracking