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

[Spring] mustache model-properties only accessable if property is not referenced via $ref in specification file #11224

Closed
JohannesProbst opened this issue Oct 18, 2021 · 1 comment · Fixed by swagger-api/swagger-codegen-generators#989

Comments

@JohannesProbst
Copy link

Description

For e.g. the {{#isReadOnly}} mustache property is not accessible if the property is referenced via $ref in the specification file. Seen in pojo.mustache file for language Spring and it's not the only attribute not accessible (e.g. {{#example}}, {{description}} as well).

Swagger-codegen version

3.0.29

Swagger declaration file content or url

Example with not working reference ($ref) on the property grossAmount of the components -> schemas -> LiabilityInsurance:

...
LiabilityInsurance:
      type: object
      description: data necessary for calculating a vehicle liability insurance premium
      properties:
        grossAmount:
          $ref: '#/components/schemas/GrossAmount'
       variant:
           ...
GrossAmount:
      readOnly: true
      description: Gross total after calculation for the respective subdivision.
      type: number
      format: double
      multipleOf: 0.01
      example: 99.98

working example without $ref:

...
LiabilityInsurance:
      type: object
      description: data necessary for calculating a vehicle liability insurance premium
      properties:
        grossAmount:
            readOnly: true
            description: Bruttosumme nach Berechnung für die jeweilige Teilsparte.
            type: number
            format: double
            multipleOf: 0.01
            example: 99.98
       variant:
           ...
@JohannesProbst JohannesProbst changed the title mustache model-properties only accessable if property is not referenced via $ref in specification file [Spring] mustache model-properties only accessable if property is not referenced via $ref in specification file Oct 21, 2021
@johnathafelix
Copy link

I'm also facing this issue. It looks like a regression as it seems that this was fixed in #8277 and observepoint/swagger-codegen-generators#2

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

Successfully merging a pull request may close this issue.

2 participants