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

[BUG] Openapi normalizer argument not passed to the generator #824

Closed
ChamNouki opened this issue Oct 2, 2024 · 4 comments · Fixed by #830
Closed

[BUG] Openapi normalizer argument not passed to the generator #824

ChamNouki opened this issue Oct 2, 2024 · 4 comments · Fixed by #830
Assignees
Labels
bug Something isn't working released

Comments

@ChamNouki
Copy link
Contributor

🐛 Bug Report:

Describe the bug

generator arguments --openapi-normalizer seems not possible to be passed through the node CLI wrapper.

Steps to Reproduce

I've tryed to find this option in openapitools.json schema or passing it directly in the npm script openapi-generator-cli generate --openapi-normalizer KEEP_ONLY_FIRST_TAG_IN_OPERATION=true but that not seems to be passed to the generator seems generated sources for my endpoint are generated for both tags placed on in my openapi contract.

concerned extract of my openapicontract :

  /products/{gtin13}:
    description: 
    get:
      operationId: getProduct
      summary: 
      tags:
        - products
        - supplier
      parameters:
        - name: gtin13
          in: path
          schema:
            type: string
          required: true
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
          description: The related Product

Expected behavior

Could it be possible to specify openapi normalizer variable in generators specification in the openapitools.json or directly by the CLI ?

Operation System (please complete the following information):

  • OS: Mac OS
  • Version 15.0

Package System (please complete the following information):

  • Version 2.13.12
@ChamNouki ChamNouki added the bug Something isn't working label Oct 2, 2024
@ChamNouki ChamNouki changed the title [BUG] [BUG] Openapi normalizer argument not passed to the generator Oct 3, 2024
@ChamNouki
Copy link
Contributor Author

ChamNouki commented Oct 3, 2024

It seems to be possible to pass openapi normalizer argument to the generator command by specifying it in openapitools.json despite the json schema. So I open a PR to suggest a schema update : #830

@wing328
Copy link
Member

wing328 commented Oct 5, 2024

i tested with the following and it works without issue:

openapi-generator-cli generate -g ruby -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o C:\temp\ruby-client --openapi-normalizer SET_TAGS_TO_OPERATIONID=true

what errors did you get when using openapi normalizer with the CLI wrapper?

and thanks for the PR to update the schema with openapi normalizer

@ChamNouki
Copy link
Contributor Author

I didn't get any error, but the --openapi-normalizer cli arguments seems to be taken into account.

After investigating further more the --openapi-normalizer cli arguments seems to be ignored or override when using --generator-key even when used generator does not define openapi-normalizer property in json config.

So the conclusion is

  1. use --openapi-normalizer cli arguments but not --generator-key
  2. use openapi-normalizer property in generator json config when using --generator-key cli argument

Copy link

github-actions bot commented Oct 8, 2024

🎉 This issue has been resolved in version 2.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants