Skip to content

[Bug]: Boolean type is not strict #998

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

Open
afonsocraposo opened this issue Jun 5, 2025 · 1 comment
Open

[Bug]: Boolean type is not strict #998

afonsocraposo opened this issue Jun 5, 2025 · 1 comment
Labels
kind/bug Indicates an issue

Comments

@afonsocraposo
Copy link

Actual Behavior

I have this in my api spec:

"properties": {
	"active": {
		"type": "boolean"
	}
}

If in my request body I pass:

{
	"active": "invalid"
}

I get a CastError.

Expected Behavior

If in my request body I pass:

{
	"active": "invalid"
}

I get an InvalidSchemaValue because the field active is not of type boolean.

Steps to Reproduce

Have a field of type boolean. Pass a invalid string in the request body.

OpenAPI Core Version

0.19.5

OpenAPI Core Integration

django

Affected Area(s)

No response

References

No response

Anything else we need to know?

No response

Would you like to implement a fix?

No

@afonsocraposo afonsocraposo added the kind/bug Indicates an issue label Jun 5, 2025
@afonsocraposo
Copy link
Author

If this is the intended behavior, is there any way to get which field is causing the CastError form the CastError instance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Indicates an issue
Projects
None yet
Development

No branches or pull requests

1 participant