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

HTML2 generator outputs "undefined" DTOs #9923

Closed
antonio-petricca opened this issue Jul 9, 2021 · 2 comments · Fixed by #12428
Closed

HTML2 generator outputs "undefined" DTOs #9923

antonio-petricca opened this issue Jul 9, 2021 · 2 comments · Fixed by #12428

Comments

@antonio-petricca
Copy link
Contributor

Hi, I am using Open API generator plugin 5.1.1.

I instrumented my projects to generate HTML2 documentation.

It works fine for all of them but one which, for the response DTOs, prints an undefined statement as for the attached snapshot:

image

I opened the browser debug console and I found the following error:

SyntaxError: Error resolving $ref pointer "http://localhost:7001/my-api/help#/components/schemas/NickNameTypeDTO". 
Token "components" does not exist.
    at Function.syntax (help:8110)
    at Pointer.resolve (help:7898)
    at $Ref.resolve (help:7901)
    at $Refs._resolve (help:7904)
    at dereference$Ref (help:7856)
    at help:7856
    at Array.forEach (<anonymous>)
    at crawl (help:7856)
    at help:7856
    at Array.forEach (<anonymous>)

How can I further investigate on the causes of that issue?

Thank you so much!

@antonio-petricca antonio-petricca changed the title [BUG] Description HTML2 generator outputs "undefined" DTOs Jul 9, 2021
@fspreck-indiscale
Copy link

Same her with openapi-generator-cli 5.2.0. The problem seem to be $refs inside of refs, e.g.,

# ...
      responses:
        '200':
          description: Some description
          content:
            application/xml:
              schema:
                $ref: "#/components/schemas/Response"
# ...
components:
  schemas:
    Response:
      type: object
      description: Server response
      properties:
        UserInfo:
          $ref: `"#/components/schemas/UserInfo"`
    UserInfo:
      type: object
      description: Information about the user that submitted the request
      properties:
        username:
          $ref: "#/components/schemas/username"
    username:
      type: string
      example: admin
      xml:
        attribute: true

Response which contains a UserInfo will be rendered but the value of UserInfo will be undefined and username will not be shown at all.

@K-Menki
Copy link

K-Menki commented Feb 21, 2022

I have the same problem when I use openapi-generator-maven-plugin V 5.4.0 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants