-
Notifications
You must be signed in to change notification settings - Fork 531
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
Bad interaction between additionalProperties and $ref #401
Comments
Can you try changing your definition to the following and see if it helps? ...
definitions:
GenericMap:
type: object
additionalProperties:
type: integer
Container:
type: object
properties:
works:
type: object
additionalProperties:
type: string
breaks:
$ref: "#/definitions/GenericMap" |
On each of the three versions of swagger-codegen I had tested, it generates the very same output as the original spec. |
Thanks for checking. |
is it resolved in the current version of swagger-parser and swagger-codegen? |
Has anyone found a solution for this? I'm having the same issue with the typescript-axios vs. |
Still broken on Codegen |
Tried it on v3.0.34 and the problem still occurs |
Same issue for the version |
So is anybody managing this project or what?. People been complaining about this since 2019 and still no answer?. |
Any news about this ? |
Same issue for the version v3.0.44 |
Same issue for the version v3.0.50 |
Still broken for the version |
Description
Compiling the following spec into a TypeScript-Fetch client results in invalid code.
Specifically, the generated code contains
which the TypeScript compiler rejects.
Swagger-codegen version
I tested it on swagger-codegen 2.2.1 (latest stable), 2.3.0 (7aebcfa) and master (d11d0f8).
Swagger declaration file content or url
Command line used for generation
swagger-codegen generate -i test.yaml -l typescript-fetch
Steps to reproduce
Compile a swagger API containing the definitions mentioned above into a typescript-fetch client.
Further data
This was originally reported as swagger-api/swagger-codegen#4839
@wing328 suggested to report the issue here as it is likely related to some problems with the resolution of the reference.
The text was updated successfully, but these errors were encountered: