You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both `sortSet` and `sortComponentsSet` are optional when you call `openapiSort`. When omitted, openapi-format automatically applies the built-in defaults (the same ones the CLI uses). The helper functions `getDefaultSortSet` and `getDefaultSortComponentsSet` are provided in case you want to start from the defaults and tweak them before invoking `openapiSort` in your own scripts.
### Using the file helpers for YAML/JSON OpenAPI documents
1635
+
1636
+
The module also exports the same helpers the CLI relies on for smart parsing/writing (large-number handling, YAML comments, remote loading, etc.) of OpenAPI documents:
1637
+
1638
+
```js
1639
+
const {
1640
+
parseFile,
1641
+
stringify,
1642
+
writeFile,
1643
+
openapiSort
1644
+
} = require('openapi-format');
1645
+
1646
+
const input = await parseFile('openapi.yaml'); // local path or remote URL
0 commit comments