Skip to content

Implement skipping strict enums during parsing#44

Merged
manchenkoff merged 2 commits intomanchenkoff:masterfrom
sergei-maertens:feature/40-loose-enum-validation
Sep 12, 2022
Merged

Implement skipping strict enums during parsing#44
manchenkoff merged 2 commits intomanchenkoff:masterfrom
sergei-maertens:feature/40-loose-enum-validation

Conversation

@sergei-maertens
Copy link
Contributor

Fixes #40

Added the strict_enum flag to the parse function, which is forwarded to the underlying builders. The default value is True to keep the current default behaviour.

The Loose<EnumType> classes mimick the Enum API through the value attribute, so downstream users don't need to check the type of Schema.format or Content.type.

Copy link
Owner

@manchenkoff manchenkoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some minor comments. There are still some errors in a build pipeline related to problematic dependency you fixed before, so, please, do the rebase/pull the actual master into your branch

@sergei-maertens
Copy link
Contributor Author

I'll apply the feedback later this week - probably it will be in the weekend. Thanks for the review!

@sergei-maertens sergei-maertens force-pushed the feature/40-loose-enum-validation branch from 994f9e6 to 5b7ab7f Compare September 11, 2022 12:26
@sergei-maertens
Copy link
Contributor Author

Rebased on master and PR feedback is processed!

Certain schema properties (content types, type formats...) are not
limited to a known set of values in the OpenAPI 3.x specification.

Users can opt-in for non-strict enum evaluation, making it possible to
parse specifications with custom content types and/or formats used in
schema definitions.
@sergei-maertens sergei-maertens force-pushed the feature/40-loose-enum-validation branch from 5b7ab7f to f33cb15 Compare September 11, 2022 12:30
@manchenkoff manchenkoff merged commit 6005fef into manchenkoff:master Sep 12, 2022
@manchenkoff
Copy link
Owner

manchenkoff commented Sep 12, 2022

@sergei-maertens published in v1.1.6 release, thanks 👍

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.

[Feature] Loosen up casting/validation logic (enforced by enums)

2 participants