Skip to content

[Feature] Add support for allowEmptyValue #8

Closed
@ehmicky

Description

@ehmicky

Should allowEmptyValue be converted to minLength: 1? At the moment, it is just deleted.

The specification is not really clear when it comes to the meaning of the word empty, but I take it they mean empty string. It's also not clear whether empty is after trimming or not. Since the minLength keyword would have no effect when type is not string, it might not be necessary to check for type to perform the conversion.

If minLength is already specified, the maximum should probably be taken.

Alternatives to minLength could be using not: { const } (JSON schema version 6 only) and using pattern (might be less performant, and would require potentially merging several patterns).

I've send an issue on the OpenAPI specification for possible clarification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions