Skip to content

Commit

Permalink
Add v2 open API spec for ml sync (#136234) (#136873)
Browse files Browse the repository at this point in the history
(cherry picked from commit b177ad9)

Co-authored-by: Lisa Cawley <lcawley@elastic.co>
  • Loading branch information
kibanamachine and lcawl authored Jul 21, 2022
1 parent f42bbbd commit 134f2ac
Show file tree
Hide file tree
Showing 5 changed files with 273 additions and 489 deletions.
12 changes: 8 additions & 4 deletions x-pack/plugins/ml/common/openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ The current self-contained spec file can be used for online tools like those fou

A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/).

The `ml_apis_v3.yaml` file uses OpenAPI Specification Version 3.0.

The `ml_apis_v2.json` file uses OpenAPI Specification Version 2.0.

## Tools

It is possible to validate the docs before bundling them by running the following command in the `x-pack/plugins/ml/common/openapi/` folder:
```
npx swagger-cli validate ml_apis.yaml
npx swagger-cli validate ml_apis_v3.yaml
```

Then generate the `bundled` files with the following commands:
You can optionally generate `bundled` files with the following commands:

```
npx @redocly/openapi-cli bundle --ext yaml --output bundled.yaml ml_apis.yaml
npx @redocly/openapi-cli bundle --ext json --output bundled.json ml_apis.yaml
npx @redocly/openapi-cli bundle --ext yaml --output bundled.yaml ml_apis_v3.yaml
npx @redocly/openapi-cli bundle --ext json --output bundled.json ml_apis_v3.yaml
```

251 changes: 0 additions & 251 deletions x-pack/plugins/ml/common/openapi/bundled.json

This file was deleted.

Loading

0 comments on commit 134f2ac

Please sign in to comment.