plantbreeding / BrAPI

Repository for version control of the BrAPI specifications
https://brapi.org
MIT License
57 stars 32 forks source link

Endpoints with same route and different query string parameters issue #566

Open 630N opened 1 year ago

630N commented 1 year ago

In .NET you can have different methods with same name and different parameters which could help you to separate logic for different functionalities. But still there is an issue in generated swagger.json file.

Remark: this handled by a feature from .NET which you can take only one from the list of endpoints, but still an issue with swagger itself.

BrapiCoordinatorSelby commented 1 year ago

Hi @alimohseni63, can you give me a specific example please? which endpoints are you having trouble with? I am not a .NET developer and I've not used the auto generated .NET code

A note on the auto code generators in general: They are not perfect. The SwaggerHub swagger-code-gen library does the best it can with the source YAML files, but it doesn't always get it right. Sometimes this can be fixed by altering the YAML files to be better structured. But other times, the way the specification is displayed as documentation, and the way it is generated into code are at odds with each other. Generally, I will lean toward making sure the specification is displayed clearly and correctly, even if it makes some odd or unintuitive generated code.

If you can identify which endpoints are causing problems, we can try to fix the YAML to correct the auto gen code, and do it without breaking the existing documentation display.