MCPcopy Index your code
hub / github.com/github/docs / validateVersionsOptions

Function validateVersionsOptions

src/rest/scripts/utils/get-openapi-schemas.js:51–65  ·  view source on GitHub ↗
(versions)

Source from the content-addressed store, hash-verified

49}
50
51export async function validateVersionsOptions(versions) {
52 const schemas = await getSchemas()
53 // Validate individual versions provided
54 versions.forEach((version) => {
55 if (
56 schemas.deprecated.includes(`${version}.deref.json`) ||
57 schemas.unpublished.includes(`${version}.deref.json`)
58 ) {
59 const errorMsg = `🛑 This script doesn't support generating individual deprecated or unpublished schemas. Please reach out to #docs-engineering if this is a use case that you need.`
60 throw new Error(errorMsg)
61 } else if (!schemas.currentReleases.includes(`${version}.deref.json`)) {
62 throw new Error(`🛑 The version (${version}) you specified is not valid.`)
63 }
64 })
65}

Callers 1

validateInputParametersFunction · 0.90

Calls 1

getSchemasFunction · 0.85

Tested by

no test coverage detected