Skip to content

apidom-reference: parser plugins are inflexible when it comes to file extensions #4298

Closed
swagger-api/swagger-ui
#10324
@char0n

Description

@char0n

Current behavior

Parser plugins support fileExtensions.

When this option is set to empty list, it means fileExtensions are not required and if provided, it's not checked what the extensions are.

When fileExtensions as set to e.g. [.yaml, .yml], is means that these are the allowed and one of those value is required. If extension is omitted the parser rejects to parse.

This feels inflexible and by default doesn't support SwaggerHUB Domains.

Proposed behavior

By default, fileExtensions should be empty list. Which means that the parser plugin will always run it's detection mechanism to determine the format and specification within the file object. No file or URL will be rejected just because it doesn't have a proper file extension.

Anybody that is looking for a strict behavior of requiring file extensions, it will still be possible to configure it, by just setting e.g. [.yaml, .yml] as fileExtensions.


Warning

an additional effect of not handling file extensions by default, is that a lot of files will now fall under YAML parser, which considers a lot string a valid YAML.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions