Skip to content

Unify library API #64

@ErikWittern

Description

@ErikWittern

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions