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

Configure drf-spectacular schema to more closely match drf-yasg #1670

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

glennmatthews
Copy link
Contributor

Relates-to: nautobot/nautobot-ansible#135

What's Changed

Although the OpenAPI 3.0 schema is fundamentally different in its structure from OpenAPI 2.0, we can configure drf-spectacular to make it match a bit more closely in the parts that can be treated similarly. Specifically it turns out that nautobot-ansible was introspecting the schema to identify the set of valid query parameters that can be used in filtering the device/VM inventory, and our schema was just different enough to break that introspection. This set of config changes should reduce the impact to that library.

I verified that the Swagger UI still works correctly after this change.

Nautobot 1.2:

image

image

Nautobot 1.3.1:

image

(note leading /api on paths)

image

image

After this changeset:

image

image

image

@glennmatthews glennmatthews self-assigned this Apr 20, 2022
@bryanculver bryanculver added the type: bug Something isn't working as expected label Apr 20, 2022
@bryanculver bryanculver merged commit 08f6504 into develop Apr 21, 2022
bryanculver added a commit that referenced this pull request Apr 21, 2022
@glennmatthews glennmatthews deleted the gfm-schema-finetuning branch July 29, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants