Skip to content

Object with required fields can be null #25

@yannh

Description

@yannh

Some objects with fields marked as required can be null, if I understand this correctly this should not be the case and can result in JSONs missing required fields being marked as valid.

For example this here:

"required": [
"apiVersion",
"kind",
"name",
"uid"
],
"type": [
"object",
"null"
],

I believe it might come from this line https://github.com/instrumenta/openapi2jsonschema/blob/d697cbff8a25f520e125e3a5f79cb4e9b972e8ce/openapi2jsonschema/util.py#L67 - I am not sure to understand why the last condition is there?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions