()
| 32 | const SANDBOX_SERVER = "https://{region}.sandbox.example.test/v1"; |
| 33 | |
| 34 | const multiServerSpec = (): string => |
| 35 | JSON.stringify({ |
| 36 | openapi: "3.0.3", |
| 37 | info: { title: "Regions API", version: "1.0.0" }, |
| 38 | servers: [ |
| 39 | { url: PROD_SERVER, description: "Production" }, |
| 40 | { |
| 41 | url: SANDBOX_SERVER, |
| 42 | description: "Regional sandbox", |
| 43 | variables: { |
| 44 | region: { default: "us", enum: ["us", "eu", "ap"], description: "Sandbox region" }, |
| 45 | }, |
| 46 | }, |
| 47 | ], |
| 48 | paths: { |
| 49 | "/ping": { |
| 50 | get: { |
| 51 | operationId: "ping", |
| 52 | summary: "Health check", |
| 53 | responses: { "200": { description: "pong" } }, |
| 54 | }, |
| 55 | }, |
| 56 | }, |
| 57 | }); |
| 58 | |
| 59 | // Minimal structural view of the JSON Schema we assert against. |
| 60 | type ServerInputSchema = { |
no outgoing calls
no test coverage detected