Skip to content

Commit

Permalink
docs: update READMEs
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Ralphson <[email protected]>
  • Loading branch information
MikeRalphson committed Jun 19, 2021
1 parent f5db739 commit 728427a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 203 deletions.
1 change: 0 additions & 1 deletion API.md

This file was deleted.

79 changes: 5 additions & 74 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ First of all, thank you for considering making a contribution to the project.
To add an API to the collection, there must be a machine-readable API description in a format which is or can be converted to OpenAPI (Swagger). These include RAML, API Blueprint, IO Docs, WADL and Google Discovery Format.

First please check that the API you wish to add isn't already in the collection. You can
browse the APIs in [GitHub](https://github.com/APIs-guru/openapi-directory/tree/master/APIs) or on the [APIs.guru](https://apis.guru/browse-apis/) website.
browse the APIs in [GitHub](https://github.com/APIs-guru/openapi-directory/tree/main/APIs) or on the [APIs.guru](https://apis.guru/) website.

Please also check the API isn't in the process of being added, by checking the [list of open issues](https://github.com/APIs-guru/openapi-directory/issues).

Expand All @@ -19,92 +19,23 @@ The API should meet the following criteria:

The easiest way to request an API to be added is to use the [web form](https://apis.guru/add-api/).

### Adding an API via a Pull-Request

Clone the repo locally, if you haven't already done so, and run the following

* run `npm install` to install the dependencies for the utility script
* create a new branch for the PR
* change into the APIs directory
* run `../scripts/collection.js add -c {category} [-l {logo-url}|-t {twitter handle}] {format} {url-to-definition}`

Run `../scripts/collection.js add --help` for a complete list of options.

`{category}` should be one of the values from [/resources/categories.yaml](/resources/categories.yaml), and `{format}` be one of:

* `openapi_3`
* `swagger_2`
* `swagger_1`
* `api_blueprint`
* `raml`
* `io_docs`
* `google`
* `wadl`

If your API definition is unofficial, also specify the `--unofficial` flag.

If there are no validation errors:

* commit your change (including any `patch.yaml` created)
* push your change
* create a Pull Request

## Amending an API definition

### Adding information

If you wish to only add information to the API definition, such as a description, category, logo, tag etc, you can amend the `patch.yaml` file found in the APIs directory. The file is merged with the `swagger.yaml` or `openapi.yaml` file, so the structure should follow that of an OpenAPI definition, including only those properties necessary to place your addition correctly.

For example:

```yaml
info:
description: Our unified API brings together data across all modes of transport into a single RESTful API. This API provides access to the most highly requested realtime and status infomation across all the modes of transport, in a single and consistent way. Access to the developer documentation is available at https://api.tfl.gov.uk
x-logo:
url: 'https://pbs.twimg.com/profile_images/773531056670646272/dsuVeVSg.jpg'
x-apisguru-categories:
- location
- open_data
```
Please issue a Pull Request, it is not necessary to raise an Issue as well.
If you wish to only add information to the API definition, such as a description, category, logo, tag etc, please raise an issue with the relevant details.

### Changing / Fixing an API definition

First please see if you can make your fix upstream with the owner of the API definition, this benefits everyone and is less work than maintaining patches.

Check the `info.contact` section of the API definition or the `x-origin` to see if there is an email or Twitter contact, or a GitHub repository you can contribute to.

#### Do not amend swagger/openapi.yaml files directly
#### Do not raise PRs to amend the openapi/swagger.yaml files directly

If you do this, your changes will be overwritten the next time the API update scripts are run.

The exception to this are APIs.guru-specific specification extensions (aka vendor extensions). Some of these are round-tripped between the modified API definitions on each update.

These extensions are [documented in the Wiki](https://github.com/APIs-guru/openapi-directory/wiki/specification-extensions#apisguru-extensions).

#### Creating a fixup.yaml patch

To do this, you will need to fork the repository and clone your fork locally.

These instructions should work on Linux or other Unix variants, MacOSx and Windows using the Git for Windows shell.

Create a new branch off master using the command:

`git checkout -b {new-branch-name}`

Change into the `APIs` directory.

Ensure your `EDITOR` environment variable is set to a terminal editor such as vi or emacs.

Issue the command `node ../scripts/collection fixup {path/to/swagger.yaml}`

Edit the `swagger.yaml` or `openapi.yaml` file and save.

Issue the command `node ../scripts/collection update {directory-name}` to reprocess the definition from source.

As long as there are no errors...
#### If you want to run our add/update/validate/repair scripts locally

Commit your change with an informative commit message, and push to the new branch on your fork.
Please contact us for details.

Create a Pull Request on GitHub.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 APIs-guru
Copyright (c) 2021 APIs-guru

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 8 additions & 8 deletions branding/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
If you're using our catalog to create a product or service we would appreciate if you would spread the word about this project.
If you're using our directory to create a product or service we would appreciate if you would spread the word about this project.
It's not mandatory, but definitely helps us to grow bigger and the entire API ecosystem will benefit.

Pages which show some info from our catalog could have one of the following links:
Pages which show info from our directory should have one of the following links:
- **Powered by \<LOGO\>**
- **API specs supplied by \<LOGO\>**
- **API definitions supplied by \<LOGO\>**

All links should point to http://APIs.guru, at the moment it's **temporarily** redirected to GitHub repo.
All links should point to https://APIs.guru.

You should use only official logos:

| [Logo]| [Horizontal logo]| [Vertical logo]|
|-------|------------------|----------------|
|![Logo]|![Horizontal logo]|![Vertical logo] |

The correct way to write our name is **APIs.guru** with exact this combination of uppercase and lowercase letters.
We recommended using the [Sansation](http://www.dafont.com/sansation.font) font, or simply use the logo with name included.
The correct way to write our name is **APIs.guru** with exactly this combination of uppercase and lowercase letters.
We recommended using the [Sansation](http://www.dafont.com/sansation.font) font, or simply use the logo with the name included.

If you want to write article or blog post, please use our banner image:
![Banner](https://raw.githubusercontent.com/APIs-guru/openapi-directory/master/branding/banner.svg)
If you want to write an article or blog post, please use our banner image:
![Banner](https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/branding/banner.svg)

### Adding an API to the collection

Expand Down
119 changes: 0 additions & 119 deletions resources/categories.yaml

This file was deleted.

0 comments on commit 728427a

Please sign in to comment.