question: Remove QueryOptions and WriteOptions embedded structs from models
DerekStrickland opened this issue · 2 comments
DerekStrickland commented
##Problem
- Currently, the API exposes the RPC QueryOptions/WriteOptions on input/output structs returned from the primary Nomad API package.
- This is confusing as a user because all of those options are also accepted as parameters (query or header).
- It would be less confusing to users if the generated request/response models excluded those structs and could rely solely on the parameters.
- Currently, the generated models have setters for the embedded struct fields, but the framework ignores them and instead consumes the passed parameters
- Uninitiated contributors might easily make the mistake of bypassing the parameter parsing methodology if they rely on IntelliSense discovery rather than looking at existing implementations.
- Inclusion of these embedded structs bloats the generated models, the payload size, and the generated YAML.
- I'd like to remove these embedded structs from the request/response models, but I am unsure if it is safe to do so.
- Generally, the handler code maps the input parameters to the RPC structs before making RPC calls, but not having been through all the handlers yet, I am unclear if this is always guaranteed.
@schmichael @jrasell Can one of you weigh in on whether this will be safe to do, or point me in the direction of the best person to ask?
DerekStrickland commented
Confirmed with team that this is safe to do.
DerekStrickland commented
Won't do