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

Unify library API #64

Open
ErikWittern opened this issue Jun 5, 2021 · 0 comments
Open

Unify library API #64

ErikWittern opened this issue Jun 5, 2021 · 0 comments

Comments

@ErikWittern
Copy link
Owner

This library currently has two methods getSnippets and getEndpointSnippets, the latter of which depends on 4 arguments which must be provided in the right order. Adding additional arguments (e.g., as suggested in #62) would decrease usability, arguably.

I think that generally, the API of this library might be improved to become:

OpenAPISnippet.getSnippets(openApi, options) 

..., where options may contain things like targets and path + method to select which operation to generate snippets for (instead of having a separate method getEndpointSnippets). This refactor would make it more feasible to add further options. E.g., w.r.t. #62 it could also contain a new serverIndex option to denote which server to use.

Any thoughts?

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

1 participant