Skip to content
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

Don't generate an inline object for objects with no properties #371

Merged

Conversation

kelnos
Copy link
Member

@kelnos kelnos commented Aug 16, 2019

The core doesn't really know how to emit objects like that (so it doesn't, and we end up with a compile error when building the generated classes). At any rate, if there's a bare object type without any
properties, our assumption is that the user is expected to populate it with whatever data is applicable: arbitrary key/value pairs, primitive types, whatever; so in this case we should just use objectType() (io.cire.Json or Jackson JsonNode).

Issue introduced in #356 -- unfortunately at the time we didn't have a specific test for this, so no surprise we didn't catch it.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

The core doesn't really know how to emit objects like that (so it
doesn't, and we end up with a compile error when building the generated
classes).  At any rate, if there's a bare object type without any
properties, our assumption is that the user is expected to populate it
with arbitrary key/value pairs (sorta like a map, but I guess they get
more freedom for keys?), so in this case we should just use
objectType() (io.cire.Json or Jackson JsonNode).
@kelnos kelnos force-pushed the fix-anonymous-additional-properties branch from af409f7 to bc2df0e Compare August 16, 2019 04:18
@kelnos kelnos merged commit 2332fa3 into guardrail-dev:master Aug 16, 2019
@kelnos kelnos deleted the fix-anonymous-additional-properties branch August 16, 2019 04:31
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.

1 participant