Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ada] Wrong packages in Ada client #193

Closed
michelealbano opened this issue Jun 1, 2018 · 1 comment
Closed

[Ada] Wrong packages in Ada client #193

michelealbano opened this issue Jun 1, 2018 · 1 comment

Comments

@michelealbano
Copy link
Contributor

Description

When creating the *-clients.ads and *.clients.adb files, the parameters of methods are of type:
Packagename.Models.Packagename.Models.Typename_Type
instead of:
Packagename.Models.Typename_Type

openapi-generator version

Master (3.0.0)

OpenAPI declaration file content or url
openapi: 3.0.0

info:
  title: problem

servers:
 - url: 'https://127.0.0.1:register'

paths:
  /remove:
    put:
      description: Removes services
      operationId: remove
      requestBody:
        content:
          'application/x-www-form-urlencoded':
            schema:
              $ref: '#/components/schemas/serviceRegistryEntryType'
      responses:
        200:
          description: Description of the service instance(s) that were removed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/serviceRegistryEntryType'
        204:
          description: No content
        default:
          description: Unexpected error

components:
  schemas:
    serviceRegistryEntryType:
      type: object
      properties:
        provider:
          $ref: '#/components/schemas/arrowheadSystemType'
        isUDP:
          type: boolean
    arrowheadSystemType:
      type: object
      properties:
        systemName:
          type: string
Command line used for generation

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -o ../ada-openapi/ --model-package Arrowhead2 --additional-properties projectName=Arrowhead1 -i ../AHproblem.yml -g ada

Steps to reproduce

mvn package
process the YAML file

Related issues/PRs

N/A

Suggest a fix/enhancement

Either change the following line in client-spec.mustache.
'''
{{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{#hasMore}};{{/hasMore}}{{/allParams}}{{#returnType}};
'''
into
'''
{{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{#hasMore}};{{/hasMore}}{{/allParams}}{{#returnType}};
'''

or change what's inside '''{{dataType]]'''.

Do something similar with file client-body.mustache,

@stcarrez
Copy link
Contributor

stcarrez commented Feb 7, 2021

This issue is fixed since 2018, we can close it.

@wing328 wing328 closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants