Skip to content

Commit

Permalink
Update detectionRegExp for OpenAPI versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n authored Dec 24, 2024
1 parent 681fcc1 commit 12d083b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import { propOr, omit } from 'ramda';
import { isNotUndefined } from 'ramda-adjunct';
import { ParseResultElement, createNamespace } from '@swagger-api/apidom-core';
Expand All @@ -13,7 +14,7 @@ export { default as mediaTypes } from './media-types.ts';
* @public
*/
export const detectionRegExp =
/(?<YAML>^(["']?)openapi\2\s*:\s*(["']?)(?<version_yaml>3\.0\.(?:[1-9]\d*|0))\3(?:\s+|$))|(?<JSON>"openapi"\s*:\s*"(?<version_json>3\.0\.(?:[1-9]\d*|0))")/m;
/(?<YAML>^(["']?)openapi\2\s*:\s*(["']?)(?<version_yaml>3\.0\.[0123](?:-rc[012])?)\3(?:\s+|$))|(?<JSON>"openapi"\s*:\s*"(?<version_json>3\.0\.[0123](?:-rc[012])?)")/m;

/**
* @public
Expand Down

0 comments on commit 12d083b

Please sign in to comment.