MCPcopy Index your code
hub / github.com/nestjs/swagger / setOpenAPIVersion

Method setOpenAPIVersion

lib/document-builder.ts:55–68  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

53 }
54
55 public setOpenAPIVersion(version: string): this {
56 // OpenAPI Specification versions follow semver, so each segment may contain
57 // one or more digits (e.g. `3.0.10`, `3.10.0`). Anchored regex accepts any
58 // non-negative integer per segment; the previous `^\d\.\d\.\d$` pattern
59 // rejected otherwise-valid spec versions.
60 if (/^\d+\.\d+\.\d+$/.test(version)) {
61 this.document.openapi = version;
62 } else {
63 this.logger.warn(
64 'The OpenApi version is invalid. Expecting format "x.x.x"'
65 );
66 }
67 return this;
68 }
69
70 public addServer(
71 url: string,

Calls

no outgoing calls

Tested by

no test coverage detected