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

[FEATURE] Lint API specs #205

Closed
dblock opened this issue Mar 21, 2024 · 3 comments · Fixed by #240
Closed

[FEATURE] Lint API specs #205

dblock opened this issue Mar 21, 2024 · 3 comments · Fixed by #240
Assignees
Labels
enhancement New feature or request

Comments

@dblock
Copy link
Member

dblock commented Mar 21, 2024

Is your feature request related to a problem?

In #203 we renamed a path parameter from NodeId to node_id because it caused a downstream generator in the opensearch-py client to produce a camelCase parameter which was caught in a linter there and errored.

What solution would you like?

A linter for consistency in the API spec for parameters, variables, etc.

Do you have any additional context?

opensearch-project/opensearch-py#700 (comment)

@dblock dblock added enhancement New feature or request untriaged and removed untriaged labels Mar 21, 2024
@dblock dblock removed the untriaged label Apr 2, 2024
@nhtruong nhtruong self-assigned this Apr 2, 2024
@nhtruong
Copy link
Collaborator

nhtruong commented Apr 2, 2024

I think the reason that we should change params like NodeId to node_id is to stay consistent with the rest of the spec where snake case is used through out. While Python convention goes for node_id, other languages like JS actually prefers nodeId. The current JS client actually accepts both node_id (because this is what appears in the doc) and nodeId (because this is a JS' convention).

On a related topic, moving forward, we should get rid of nodeId in clients like JS. It adds overheads to the client code for a very small benefit. This will be breaking change though. So, we should combine this with the JS client rewrite in TS.

@nhtruong
Copy link
Collaborator

nhtruong commented Apr 2, 2024

I will add this to the validator im working on as one of the follow up PRs.

@dblock
Copy link
Member Author

dblock commented Apr 9, 2024

Coming from #218, linter should check description format (capitalized, full sentences with periods), and no line wrapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants