Преглед изворни кода

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

Add CORS column
pull/590/head
Dave Machado пре 6 година
committed by GitHub
родитељ
комит
67422f7508
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 измењених фајлова са 615 додато и 600 уклоњено
  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 Прегледај датотеку

@@ -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
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 2
- 1
build/md2json.py Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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]


Loading…
Откажи
Сачувај