You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tool generates an empty model class for UserId, i.e. a class without properties. This makes things unusable because when deserializing API response to User object it sets id property to empty UserId object.
IMO we should not generate classes for models that are not objects. If a property is a reference to the model that is not an object then we should inherit a type from this model.
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Codegen generates models for schemas that are not objects
[PHP] Codegen generates models for schemas that are not objects
Aug 18, 2024
Description
I have an endpoint that returns a User object:
And models:
This tool generates an empty model class for UserId, i.e. a class without properties. This makes things unusable because when deserializing API response to User object it sets
id
property to empty UserId object.IMO we should not generate classes for models that are not objects. If a property is a reference to the model that is not an object then we should inherit a type from this model.
Example from PHP:
Current behaviour
Expected behaviour
Swagger-codegen version
swaggerapi/swagger-codegen-cli-v3:3.0.61
Swagger declaration file content or url
Command line used for generation
docker run --rm -v "${PWD}" swaggerapi/swagger-codegen-cli-v3:3.0.61 generate -i /swagger.yml -l php
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: