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

python: Add special case where the server does not send a camelCase field #1679

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

svix-mman
Copy link
Contributor

@svix-jplatte here is where this field is defined

@svix-mman svix-mman requested a review from a team as a code owner January 30, 2025 22:21
@svix-mman svix-mman changed the title python: Add special case where the server does not send a camelCase python: Add special case where the server does not send a camelCase field Jan 30, 2025
Copy link
Member

@tasn tasn left a comment

Choose a reason for hiding this comment

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

If the server is bad, fix the server.

@svix-jplatte
Copy link
Member

If the server is bad, fix the server.

That would break all existing code parsing the reasons of that endpoint, though?

@tasn
Copy link
Member

tasn commented Jan 31, 2025

Ah, it's "out", I thought it was in. Sorry.

I guess this is something we should handle in the generator automatically, so something like "if property name is not camelcase then generate an alias here explicitly".

Though can we please also fix it server side by calling it something completely separate and returning the field twice (and deprecating the old field or better yet, hiding it altogether)? E.g. call it "potential" or "applicable" or something.

Though I guess this can be done at a later stage. Though at least the lib generation should handle this automatically though.

@svix-mman
Copy link
Contributor Author

I guess this is something we should handle in the generator automatically, so something like "if property name is not camelcase then generate an alias here explicitly".

I added this PR that generates this code. svix/openapi-codegen#51

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.

3 participants