Parcourir la source

Merge pull request #589 from davemachado/add-cors-column

Add CORS column
pull/590/head
Dave Machado il y a 6 ans
committed by GitHub
Parent
révision
67422f7508
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 4AEE18F83AFDEB23
4 fichiers modifiés avec 615 ajouts et 600 suppressions
  1. +11
    -5
      .github/CONTRIBUTING.md
  2. +593
    -593
      README.md
  3. +2
    -1
      build/md2json.py
  4. +9
    -1
      build/validate_format.py

+ 11
- 5
.github/CONTRIBUTING.md Voir le fichier

@@ -10,23 +10,29 @@ community build applications and use free, public APIs quickly and easily. Pull

Current API entry format:

| API | Description | Auth | HTTPS | Link |
| --- | --- | --- | --- | --- |
| API Title | Description of API | Does this API require authentication? * | Does the API support HTTPS? | Link to API webpage |
| API | Description | Auth | HTTPS | CORS | Link |
| --- | --- | --- | --- | --- | --- |
| API Title | Description of API | Does this API require authentication? * | Does the API support HTTPS? | Does the API support [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)? * | Link to API webpage |

Example entry:

```
| NASA | NASA data, including imagery | No | Yes | [Go!](https://api.nasa.gov) |
| NASA | NASA data, including imagery | No | Yes | Yes | [Go!](https://api.nasa.gov) |
```

\* Currently, the only accepted inputs for this field are as follows:
\* Currently, the only accepted inputs for the `Auth` field are as follows:

* `OAuth` - _the API supports OAuth_
* `apiKey` - _the API uses a private key string/token for authentication - try and use the correct parameter_
* `X-Mashape-Key` - _the name of the header which may need to be sent_
* `No` - _the API requires no authentication to run_

\* Currently, the only accepted inputs for the `CORS` field are as follows:

* `Yes` - _the API supports CORS_
* `No` - _the API does not support CORS_
* `Unknown` - _it is unknown if the API supports CORS_

Please continue to follow the alphabetical ordering that is in place per section. Each table column should be padded with one space on either side.

If an API seems to fall into multiple categories, please place the listing within the section most in line with the services offered through the API. For example, the Instagram API is listed under `Social` since it is mainly a social network, even though it could also apply to `Photography`.


+ 593
- 593
README.md
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 2
- 1
build/md2json.py Voir le fichier

@@ -22,7 +22,8 @@ def markdown_to_json(filename, anchor):
'Description': chunks[1],
'Auth': None if chunks[2].upper() == 'NO' else chunks[2].strip('`'),
'HTTPS': True if chunks[3].upper() == 'YES' else False,
'Link': chunks[4].replace('[Go!]', '')[1:-1],
'CORS': chunks[4].strip('`'),
'Link': chunks[5].replace('[Go!]', '')[1:-1],
'Category': category,
}
entries.append(entry)


+ 9
- 1
build/validate_format.py Voir le fichier

@@ -8,12 +8,14 @@ anchor = '###'
auth_keys = ['apiKey', 'OAuth', 'X-Mashape-Key', 'No']
punctuation = ['.', '?', '!']
https_keys = ['Yes', 'No']
cors_keys = ['Yes', 'No', 'Unknown']

index_title = 0
index_desc = 1
index_auth = 2
index_https = 3
index_link = 4
index_cors = 4
index_link = 5

errors = []

@@ -91,6 +93,12 @@ def check_format(filename):
if https not in https_keys:
add_error(line_num, "{} is not a valid HTTPS option".format(https))
# END HTTPS
# START CORS
# values should conform to valid options only
cors = segments[index_cors]
if cors not in cors_keys:
add_error(line_num, "{} is not a valid CORS option".format(cors))
# END CORS
# START Link
# url should be wrapped in '[Go!]()' Markdown syntax
link = segments[index_link]


Chargement…
Annuler
Enregistrer