MCPcopy Index your code
hub / github.com/pmxt-dev/pmxt / collectAllCodeSamples

Function collectAllCodeSamples

core/test/unit/openapi-code-samples.test.js:77–82  ·  view source on GitHub ↗
(spec)

Source from the content-addressed store, hash-verified

75}
76
77function collectAllCodeSamples(spec) {
78 return Object.values(spec.paths || {})
79 .flatMap((pathItem) => Object.values(pathItem || {}))
80 .filter((operation) => operation && typeof operation === 'object')
81 .flatMap((operation) => operation['x-codeSamples'] || []);
82}
83
84function withGeneratedSpec(assertion) {
85 const snapshot = snapshotGeneratedFiles();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected