Skip to content

chore: handle any Type with object datatype #858

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

Merged
merged 12 commits into from
Jun 12, 2025
Merged

Conversation

tiwarishubham635
Copy link
Contributor

@tiwarishubham635 tiwarishubham635 commented May 16, 2025

Fixes

For objects that are anyType, the correct java datatype should be Object instead of Map.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

@tiwarishubham635 tiwarishubham635 changed the title chore: handle free form with object datatype chore: handle any Type with object datatype Jun 5, 2025
try {
return MAPPER.writeValueAsString(map);
if (map instanceof Map) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to create a separate function for object.
Primitive data types will be handled by using toString method. But 'List' datatype might not be handled by toString so we should write separate converters for such objects.

Copy link

@sbansla sbansla self-requested a review June 12, 2025 08:00
@tiwarishubham635 tiwarishubham635 merged commit fbdac1a into main Jun 12, 2025
13 checks passed
@tiwarishubham635 tiwarishubham635 deleted the test-branch branch June 12, 2025 08:42
tiwarishubham635 added a commit to twilio/twilio-oai-generator that referenced this pull request Jun 12, 2025


# Fixes #

Handling any Type objects.
Preview PR in java - twilio/twilio-java#858

### Checklist
- [x] I acknowledge that all my contributions will be made under the
project's license
- [ ] Run `make test-docker`
- [ ] Verify affected language:
- [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our
[OpenAPI specification](https://github.com/twilio/twilio-oai) using the
[build_twilio_go.py](./examples/build_twilio_go.py) using `python
examples/build_twilio_go.py path/to/twilio-oai/spec/yaml
path/to/twilio-go` and inspect the diff
    - [ ] Run `make test` in `twilio-go`
    - [ ] Create a pull request in `twilio-go`
    - [ ] Provide a link below to the pull request
- [ ] I have made a material change to the repo (functionality, testing,
spelling, grammar)
- [ ] I have read the [Contribution
Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md)
and my PR follows them
- [ ] I have titled the PR appropriately
- [ ] I have updated my branch with the main branch
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added the necessary documentation about the functionality
in the appropriate .md file
- [ ] I have added inline documentation to the code I modified

If you have questions, please create a GitHub Issue in this repository.
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 this pull request may close these issues.

2 participants