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

[gen] adding support for "Any" and "AnyObject" as json in codegen #3205

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hochgi
Copy link
Contributor

@hochgi hochgi commented Nov 12, 2024

/fixes #3199
/claim #3199

@@ -1077,7 +1078,10 @@ final case class EndpointGen(config: Config) {
),
)
case JsonSchema.Null => throw new Exception("Null query parameters are not supported")
case JsonSchema.AnyJson => throw new Exception("AnyJson query parameters are not supported")
case JsonSchema.AnyJson => {
// throw new Exception("AnyJson query parameters are not supported")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why did we previously throw exception?
Am I breaking some other validation now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@987Nabil any idea regarding this one?

eats: {}
extra_attributes:
type: object
additionalProperties: true
Copy link
Contributor Author

@hochgi hochgi Nov 12, 2024

Choose a reason for hiding this comment

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

should also test for all the 3 out of 4 possible cases we handle?

  extra_attributes:
    type: object
    additionalProperties: true

  extra_attributes:
    type: object
    additionalProperties: {}

  extra_attributes:
    additionalProperties: true

  extra_attributes:
    type: object
    additionalProperties: true

  extra_attributes:
    type: object
    additionalProperties: {}

  extra_attributes:
    additionalProperties: true

but fails for this case, which might not be an issue (or an issue with zio-schema):

  extra_attributes:
    additionalProperties: {}
@hochgi hochgi force-pushed the gen-issue-3199-support-any-and-any-object-as-json branch from d4ef6d4 to afe0bce Compare November 29, 2024 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gen] accept OpenAPI "open" types like "any" & "anyObject"
1 participant