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

feat: introducing path prefix support for SchemaTester #25

Merged

Conversation

maticardenas
Copy link
Owner

@maticardenas maticardenas commented Mar 12, 2024

Introducing support for passing a path_prefix to SchemaTester class.

In some cases where many APIs shared the same path prefix (e.g. api/v1/), it could be that this is included in the server URL to avoid repetition.
Given this prefix might be part of the urls paths defined in Django, it leads to the library to not find the corresponding paths in the schema (e.g. url path in django /api/v1/pets while in the schema the path is just /pets).

This PR adds a new argument to allow passing a prefix to match with django paths, in case this one is appended in the server url of the OpenAPI specification.

@maticardenas maticardenas self-assigned this Mar 12, 2024
@maticardenas maticardenas linked an issue Mar 12, 2024 that may be closed by this pull request
@maticardenas maticardenas marked this pull request as draft March 12, 2024 21:43
@maticardenas maticardenas force-pushed the 24-add-possibility-of-defining-a-prefix-for-the-api-path branch from 3c0f59d to c0f065f Compare March 12, 2024 21:51
@maticardenas maticardenas force-pushed the 24-add-possibility-of-defining-a-prefix-for-the-api-path branch from c0f065f to 638c3f9 Compare March 12, 2024 21:52
@maticardenas maticardenas marked this pull request as ready for review March 14, 2024 16:49
@maticardenas maticardenas merged commit 9f9687f into master Mar 14, 2024
14 checks passed
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

Successfully merging this pull request may close these issues.

Add possibility of defining a "prefix" for the API path
1 participant