The package also exposes a ton of utilities which you can use like building blocks:
import { normalize } from '@scalar/openapi-parser'
// pass an object, JSON or YAML and get an object
const result = normalize(input)
Modify the given specification
import { traverse } from '@scalar/openapi-parser'
// recursively go through the specification and modify it on all levels
const result = traverse(specification, (schema) => {
schema['x-annotation'] = 'foobar'
return schema
})
This PR is huge:
It’s not really done, but let’s get this out and take some smaller steps to iterate on it. :)
Validate
Filter
Resolve
Upgrade to OpenAPI 3.1
The package also exposes a ton of utilities which you can use like building blocks:
Modify the given specification