Skip to content

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

@stcarrez

Description

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions