Skip to content

Commit

Permalink
Update @adaptate/utils readme
Browse files Browse the repository at this point in the history
  • Loading branch information
p10ns11y committed Nov 11, 2024
1 parent c008b27 commit eb4946a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions packages/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ Spec parser that takes care of the usage of `$ref`.
```ts
import { getDereferencedOpenAPIDocument } from '@adaptate/utils';

let dereferencedOpenAPIDocument = await getDereferencedOpenAPIDocument(
import.meta.url,
'../fixtures/base-schema.yml'
);
// from local disk
let dereferencedOpenAPIDocument = await getDereferencedOpenAPIDocument({
environment: 'server',
callSiteURL: import.meta.url,
relativePathToSpecFile: '../fixtures/base-schema.yml',
});

// or from web

let dereferencedOpenAPIDocument = await getDereferencedOpenAPIDocument({
environment: 'browser',
webURL: 'https://api.apis.guru/v2/specs/googleapis.com/books/v1/openapi.yaml',
});

for (let [name, schema] of Object.entries(
dereferencedOpenAPIDocument.components.schemas
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adaptate/utils",
"version": "0.1.0-beta",
"version": "0.1.0-beta.1",
"author": {
"name": "Peramanathan Sathyamoorthy",
"url": "https://github.com/p10ns11y/adaptate.git"
Expand Down

0 comments on commit eb4946a

Please sign in to comment.