anomaly / lab-web-client

A template for building accessible, localised, high performance React front ends with a standard set of libraries. Also provides a template for development servers.
Apache License 2.0
2 stars 0 forks source link

Explore if it possible to have the OTC client generate prettier function names #6

Closed devraj closed 2 years ago

devraj commented 2 years ago

Readability counts, and while we understand that there are limitations when it comes to code generation, we should explore if there are ways to configure the server API so the client side generates more readable names.

OTC client already uses names spaces which breaks things down, however the method names could read better

devraj commented 2 years ago

It is possible to override the names of the generated functions by providing an operation_id flag to the router endpoints. For the sake of readability this is highly encouraged.

Read FastAPI params to see how this configured.

We should provide guidelines in this lab around how to name operations specially with the knowledge that OTC is able to use namespaces which are grouped by tags, which highlights the need for using tags in a more systematic manner.

devraj commented 2 years ago

Review this section of the FastAPI docs to help autogenerate these names https://fastapi.tiangolo.com/es/advanced/generate-clients/#custom-generate-unique-id-function

at the moment we are doing it by manually providing an operation_id