Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

fix(#31): set default version temporarily #27

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/openapi-parser/src/lib/Validator/Validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export class Validator {
// TODO: How does this work with a filesystem?
this.specification = specification

// TODO: defaulting info.version to keep parser compatible with the previous one
// we should bubble this error up and not throw on it
if (this.specification?.info && !this.specification.info.version) {
this.specification.info.version = '0.0.1'
}

try {
// AnyObject is empty or invalid
if (specification === undefined || specification === null) {
Expand Down