swagger-api / swagger-api/swagger-codegen
How to deal with 'Any' type object. swagger generated code has issues while parsing POST request with content in 'Any{}' type body
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
[JAVA] Bug generating generic type object. it is defined as Any{} in open api sepc.
I generated a spring boot server using a TMF open api spec. There is a section where a gnereic type of object can be sent, it is defined as Any{} dataType . The Codegen for this has some missing annotations I believe. The Json body sent in a post request is not being mapped on to it. Can you please tell what sort of custom deserializer works good for a generic object type.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TMF OpenAPI specification and the generated Spring Boot server, focusing on the POST request body defined as Any{} and how its JSON is mapped. Compare the generated model and endpoint handling to identify the missing annotations or deserialization behavior; done means the generic JSON body is correctly mapped in the generated server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100