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

Implement tools for filtering and combining OpenAPI specs #40

Open
Manfred opened this issue Nov 5, 2023 · 1 comment
Open

Implement tools for filtering and combining OpenAPI specs #40

Manfred opened this issue Nov 5, 2023 · 1 comment
Labels
Feature Description of a feature that could be implemented

Comments

@Manfred
Copy link
Owner

Manfred commented Nov 5, 2023

When projects publish their endpoint specs in an extremely large file or in lots of smaller files you may want to massage them a little bit and only take the parts that you actually use. The idea is that Reynard can help with this because it already has an interface to navigate the specs.

For example:

# Filter based on operation names
reynard reduce --source https://example.com/openapi.json --select-operations getAuthors,getAuthor,getLibrary > openapi.yml
# Filter using a configuration file
reynard reduce --source https://example.com/openapi.json --select-file config/used.yml --format json > openapi.json
# Combine multiple sources
reynard combine --source openapi1.json --source openapi2.json > openapi.yml

It may be useful to keep a cached version of the sources and use conditional requests to speed up interaction. We should also fall back on a cached versions when an HTTP request fails with a server error.

@Manfred Manfred added the Feature Description of a feature that could be implemented label Nov 5, 2023
@Manfred
Copy link
Owner Author

Manfred commented Aug 24, 2024

There are some optional operations that could be interesting for these tools:

  1. Move all external references into the components sections of the specification so they are contained in a single file.
  2. De-duplicate parts of the specification.
  3. Remove all optional parts that are not used for actual operation so reduce the memory footprint (eg. all example properties).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Description of a feature that could be implemented
Projects
None yet
Development

No branches or pull requests

1 participant