-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[C#] Missing Models for Map types and incomplete types for Api Endpoints #255
Comments
seems broken on golang as well. |
It was reported to be broken in java as well, if I understood #191 correctly. |
For golang for example This spec creates a valid model with a map Options:
type: "object"
properties:
Config:
description: "List of configuration options"
type: "object"
additionalProperties:
type: "string" This one when referenced inside another model creates an error ResourceOperations:
description: "An object describing the operations"
type: "object"
additionalProperties:
type: "string" |
I have not even tried nested containers as yet. Does not look good for now. |
this is broken also in typescript-angular code generator |
UPDATE: I'm able to identify the issue and working on a fix (which requires changing how Map schema is handled in many places). I'm aiming for a fix ready for test by tomorrow. (codegen also has the same issue so it's not a bug we introduced to openapi generator) |
UPDATE: I'm hoping to release the fix tomorrow (Wed). Sorry for the delay. |
Filed #360 to fix it. Please give it a try when you've time. |
[SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "Successful response")]
public virtual IActionResult ApiTestConfigurationGet()
I merged the changes on my fork but it is not working. |
Fixed with #360 |
Description
With the following valid spec
The map models are not generated and the Api is having a wrong type for the response associated with map.
When a map is part of an object the model is generated correctly with the map inside the object.
When a model type is a map, there is incorrect generation of code either as an inline model or as a map when referred from another model.
General issues with inline models always being reported as objects
openapi-generator version
3.0.0
OpenAPI declaration file content or url
Command line used for generation
java -jar ~/dev/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ./Cta.yaml -o ./genserver -l aspnetcore --additional-properties packageName=Cta
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Is the Map support broken in C#
The text was updated successfully, but these errors were encountered: