mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
Warn if info.version
is omitted, error if info
is missing.
This commit is contained in:
parent
4b302d54dc
commit
ad30501c80
|
@ -63,6 +63,12 @@ export class OpenAPIParser {
|
|||
if (spec.openapi === undefined) {
|
||||
throw new Error('Document must be valid OpenAPI 3.0.0 definition');
|
||||
}
|
||||
if (spec.info === undefined) {
|
||||
throw new Error('OpenAPI 3.0.0 requires an `info` section');
|
||||
}
|
||||
if (spec.info.version === undefined) {
|
||||
console.warn('OpenAPI 3.0.0 requires setting a `info.version` field, ignoring.')
|
||||
}
|
||||
}
|
||||
|
||||
preprocess(spec: OpenAPISpec) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user