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
  • #210
Closed
Open
Issue created Jun 03, 2018 by Administrator@rootContributor

[Ada] Update the code generator for required and optional parameters

Created by: stcarrez

Description

The required parameters are no longer managed correctly in the OpenAPITools 3.0 generator. (The AdaCode generator needed some update).

By default, all parameters are declared as if they are optional and the Ada code generator uses the Nullable_T type.

openapi-generator version

3.0.0

OpenAPI declaration file content or url
    Ticket:
      type: object
      properties:
        id:
          type: integer
          format: int64
        title:
          type: string
          description: Title of the ticket
        description:
          type: string
          description: Description of the ticket
      required:
        - id
        - title
      title: Information about a ticket

With the above type, the 'title' should use the type Swagger.UString but it uses Swagger.Nullable_UString.

Command line used for generation

java -jar openapi-generator-cli.jar generate
--generator-name ada -i regtests/swagger.yaml -o regtests/client
-DprojectName=TestAPI --model-package TestAPI

Suggest a fix/enhancement

The required support was handled in the getTypeDeclaration() operation and this is no longer possible. The postProcessModels() and postProcessOperations() must take into account the required property of each parameter and update the parameter/member dataType accordingly.

Assignee
Assign to
Time tracking