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

Support strict schema checking option to prevent parameter duplication #1578

Open
VladimirSmatanik opened this issue Jan 8, 2025 · 1 comment

Comments

@VladimirSmatanik
Copy link

Is your feature request related to a problem? Please describe.
Currently, I'm able to duplicate fields in the schema multiple times and the value of the last field is taken into account and populated in a object.
"input": { "firstName": "Test", "lastName": "Surname1", "lastName": "Surname2", "lastName": "Surname3", "lastName": "Surname4", "lastName": "Surname5", }
Request such as this one is considered valid and the Surname5 value is passed in the lastName property.

Describe the solution you'd like
The generator settings could have an option for strict schema checking, where repeated fields will be considered invalid.

Describe alternatives you've considered
As an alternative there could be some specific annotation to achieve the same? Or way of marking fields.

@rwo-trackunit
Copy link
Contributor

I poked a bit around in this codebase, and it seems to me that processing input isn't within the scope of this project.
Not an expert, could be wrong.

From a Java perspective, it would be a problem in graphql-java.
I'm guessing there is a similar project for each supported language.
This project only generates java interfaces for GraphQL, it doesn't actually process it.

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

No branches or pull requests

2 participants