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

Do a pass of fixing up the naming #3

Open
laduke opened this issue Feb 13, 2024 · 6 comments
Open

Do a pass of fixing up the naming #3

laduke opened this issue Feb 13, 2024 · 6 comments

Comments

@laduke
Copy link
Contributor

laduke commented Feb 13, 2024

Some of the names are long. They are probably inconsistent with each other. This appears as long awkward names in generated clients. Let it marinate for a bit then update it.
Let me know what you don't like.

@laduke
Copy link
Contributor Author

laduke commented Feb 29, 2024

One nice thing, in openapi-ts, it doesn't use the long names, it uses the paths /api/controller, which don't change almost ever.
If you're using the json-schema for AJV or something, the name are annoying and could change.

@JohnGuan
Copy link

JohnGuan commented Nov 6, 2024

I once wrote a full version of openapi when this repo didn't exist, with a lot of operationId and type/object tweaks. For your reference.
Link: https://github.com/JohnGuan/zerotierone-openapi/blob/main/zerotierone-openapi.yaml

@laduke
Copy link
Contributor Author

laduke commented Nov 6, 2024

thanks for writing. the spec is in use in a few places with generated apis so it might be a pain to change things. will have weigh the pros and cons

@JohnGuan
Copy link

JohnGuan commented Nov 7, 2024

At least in the operationId part, in the performance of ts, all APIs use operationId to generate function names, which is very unreadable. Is this part modifiable?

@JohnGuan
Copy link

JohnGuan commented Nov 7, 2024

Sorry, I just realized that this seems to be a generated OpenAPI file written with TypeSpec. I think I’ll take some time to learn more about TypeSpec—it looks like a good way to define APIs and doesn’t seem as painful as writing OpenAPI in YAML directly.

I did a quick search and found some information about operationId, which appears to be the reason behind the unusual naming issue.
https://typespec.io/docs/libraries/openapi/reference/js-api/functions/resolveoperationid/

@laduke
Copy link
Contributor Author

laduke commented Nov 7, 2024

I think we can give better operation IDs a try.
The generators we've used so far and depend on just use the path names.

I looks like the readme needs a little update. The tests require docker now. They don't touch your local zerotier-one instance.

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