Skip to content

Commit

Permalink
fix more linters
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Nov 25, 2024
1 parent 88437f4 commit 3b74741
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions openapi/openapi/paths/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ You can adopt any organization you wish. We have some tips for organizing paths

Use a predefined "path separator" and keep all of your path files in the top level of the `paths` folder.

```
```yaml
# todo: insert tree view of paths folder
```

Redocly recommends using the `@` character for this case.

In addition, Redocly recommends placing path parameters within `{}` curly braces if you adopt this style.

#### Motivations
### Motivations

* Quickly see a list of all paths. Many people think in terms of the "number" of "endpoints" (paths), and not the "number" of "operations" (paths * http methods).

* Only the "file-per-path" option is semantically correct with the OpenAPI Specification 3.0.2. However, Redocly's openapi-cli will build valid bundles for any of the other options too.


#### Drawbacks
### Drawbacks

* This may require multiple definitions per http method within a single file.
* It requires settling on a path separator (that is allowed to be used in filenames) and sticking to that convention.
Expand All @@ -57,7 +57,8 @@ You may name your files with some concatenation for the http method. For example
### Use subfolders to mirror API path structure

Example:
```

```http request
GET /customers
/paths/customers/get.yaml
Expand All @@ -66,7 +67,8 @@ GET /customers
In this case, the path id defined within subfolders which mirror the API URL structure.

Example with path parameter:
```

```http request
GET /customers/{id}
/paths/customers/{id}/get.yaml
Expand All @@ -91,8 +93,9 @@ paths:
If you have a lot of nested folders, it may be confusing to reference your schemas.
Example
```
Example:
```yaml
file: /paths/customers/{id}/timeline/{messageId}/get.yaml

# excerpt of file
Expand All @@ -101,4 +104,5 @@ file: /paths/customers/{id}/timeline/{messageId}/get.yaml
$ref: ../../../../../components/headers/Rate-Limit-Remaining.yaml

```

Notice the `../../../../../` in the ref which requires some attention to formulate correctly. While openapi-cli has a linter which suggests possible refs when there is a mistake, this is still a net drawback for APIs with deep paths.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Aim for sections 1–6 below and try to include at least 300 words. You can move
- This is calculated from carrying out several runs (or from runs saved in the DB).<!-- @Zuzka can help if needed. [Information in this table](https://docs.google.com/spreadsheets/d/1NOkob1eYqTsRPTVQdltYiLUsIipvSFXswRcWQPtCW9M/edit#gid=1761542436), tab "cost of usage". -->
- Here’s an example for this section:

> ## How much will it cost me to scrape Google Maps reviews?
> ## How much will it cost me to scrape Google Maps reviews?
>
> <br/> Apify provides you with $5 free usage credits to use every month on the Apify Free plan and you can get up to 100,000 reviews from this Google Maps Reviews Scraper for those credits. This means 100k results will be completely free!
> <br/> But if you need to get more data or to get your data regularly you should grab an Apify subscription. We recommend our $49/month Starter plan - you can get up to 1 million Google Maps reviews every month with the $49 monthly plan! Or 10 million with the $499 Scale plan - wow!
Expand Down

0 comments on commit 3b74741

Please sign in to comment.