Add support for custom JSONSchemer configuration#318
Merged
ahx merged 1 commit intoahx:global-json-schemer-configfrom Jan 22, 2025
Merged
Conversation
Owner
|
Can you add a test for this so we avoid breaking this (again) in the future? |
Owner
|
I am struggling with finding a place to test this, but I just added something on another branch I will merge this to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small change to make it so that the global
JSONSchemer.configurationis respected whenopenapi_firstbuilds its router. I made it so thatopenapi_firstwill firstclonethe configuration before making the changes it needs to so that it avoids adjusting the global configuration in case something else in a dev's project is using it.This useful for something like supporting custom
formats. For example, I can now do something likeand
openapi_firstwill pick up that configuration and apply it to theJSONSchemer.schemas it creates as it builds the router, which allows it to work with my custom format.Prior to version 2.2, this would work. Recent changes made it so that a new
JSONSchemer::Configurationinstance was created, so any prior changes made toJSONSchemer.configurationwould no longer be applied.