Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
docs: make docs more OpenAPI friendly (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta authored Aug 25, 2021
1 parent 30342b2 commit 68cfc34
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Swagger 2 or OAS 3? YAML or JSON? URL, path, string or object? Who cares! It just works.
OpenAPI 3 or Swagger 2? YAML or JSON? URL, path, string or object? Who cares! It just works.

This module uses a bunch of other great modules to do the heavy lifting, and normalizes everything!

[![Build](https://github.com/readmeio/oas-normalize/workflows/CI/badge.svg)](https://github.com/readmeio/oas-normalize/) [![](https://img.shields.io/npm/v/oas-normalize)](https://npm.im/oas-normalize)

[![](https://cl.ly/1h271F1M1e2T/Untitled-2.png)](http://readme.io)
[![](https://d3vv6lp55qjaqc.cloudfront.net/items/1M3C3j0I0s0j3T362344/Untitled-2.png)](https://readme.com)

# Install

Expand Down Expand Up @@ -46,7 +46,7 @@ For validation errors, when available, you'll get back an object:

`message` is almost always there, but `path` is less dependable.

# Helper functions
# Helper Functions

> **Note:** All of these functions are promise-driven.
Expand All @@ -59,21 +59,20 @@ If you want some more functionality, you can do anything here:
| `.deref()` | Resolve `$ref` pointers |
| `.validate([convertToLatest?])` | Validate the whole thing! |

# Other little features
# Other Little Features

### Always return OAS 3
### Always Return OpenAPI 3.x

If you want `.validate` to always return an OpenAPI 3.0 definition, supply `true` as its argument:
If you want `.validate` to always return an OpenAPI 3.x definition, supply `true` as its argument:

```js
OASNormalize.validate(true).then(...);
```

### Enable local paths
### Enable Local Paths

For security reasons, you need to opt into allowing fetching by a local path. To enable it supply the `enablePaths` option to the class instance:

```js
const oas = new OASNormalize('./petstore.json', { enablePaths: true })
```

17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
{
"name": "oas-normalize",
"version": "3.0.5",
"description": "Swagger 2 or OAS 3? YAML or JSON? URL, path, string or object? Who cares! It just works.",
"description": "OpenAPI 3 or Swagger 2? YAML or JSON? URL, path, string or object? Who cares! It just works.",
"main": "index.js",
"engines": {
"node": "^12 || ^14 || ^16"
},
"tags": [
"api",
"apis",
"openapi",
"swagger",
"openapi initiative",
"openapi specification",
"openapi spec",
"openapi document",
"oai",
"oas",
"apidoc",
"microservice",
"documentation"
],
"repository": {
"type": "git",
"url": "git://github.com/readmeio/oas-normalize.git"
Expand Down

0 comments on commit 68cfc34

Please sign in to comment.