mirror of
https://github.com/adidas/api-guidelines.git
synced 2025-10-25 15:19:19 +00:00
Replace apiary with swaggerhub
This commit is contained in:
@@ -6,6 +6,5 @@ API-related guides:
|
||||
* Migration of Legacy Services \(SOAP\)
|
||||
* API Testing with Dredd
|
||||
* Continuous Integration / Deployment / Delivery
|
||||
* [Apiary](https://help.apiary.io/api_101/understanding-apiary/)
|
||||
* API Management
|
||||
|
||||
|
||||
@@ -13,13 +13,6 @@ The following must be available in the CI environment before testing:
|
||||
v7.5.0
|
||||
```
|
||||
|
||||
2. **Ruby** runtime MUST be available in the CI environment:
|
||||
|
||||
```text
|
||||
$ ruby -v
|
||||
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
|
||||
```
|
||||
|
||||
3. [**Dredd**](https://github.com/apiaryio/dredd) MUST be installed globally in the CI environment:
|
||||
|
||||
```text
|
||||
@@ -31,52 +24,17 @@ The following must be available in the CI environment before testing:
|
||||
dredd v2.2.5 (Darwin 16.4.0; x64)
|
||||
```
|
||||
|
||||
4. [**Apiary CLI Tool**](https://help.apiary.io/tools/apiary-cli) MUST be installed globally in the CI environment:
|
||||
|
||||
```text
|
||||
$ gem install apiaryio
|
||||
```
|
||||
|
||||
```text
|
||||
$ apiary version
|
||||
0.8.0
|
||||
```
|
||||
|
||||
5. **Apiary API Key** MUST be set in the CI Environment environment variables:
|
||||
|
||||
```text
|
||||
$ export APIARY_API_KEY=xyz
|
||||
```
|
||||
|
||||
To obtain an Apiary API key, head to [https://login.apiary.io/tokens](https://login.apiary.io/tokens) \(NOTE: You will need the "ALL" Scope\)
|
||||
|
||||
## Testing an API
|
||||
|
||||
### Test Run Prerequisites
|
||||
|
||||
To test an API within the CI environment provisioned as mentioned in the environment prerequisites, you will need the following:
|
||||
|
||||
1. The name \(subdomain\) of API project at Apiary
|
||||
1. A `swagger.yaml` file with the description of API being tested
|
||||
|
||||
```text
|
||||
$ export APIARY_API_NAME=bomapi3
|
||||
```
|
||||
The file should be fetched from [API Design Platform](design-plaform.md)
|
||||
|
||||
> See [How to find the Apiary API name](https://help.apiary.io/faq/find-api-name/) for more details.
|
||||
|
||||
2. A `swagger.yaml` file with the description of API being tested
|
||||
|
||||
To fetch the swagger.yaml file from Apiary run the following command before the test:
|
||||
|
||||
```text
|
||||
$ apiary fetch --api-name=$APIARY_API_NAME --output="swagger.yaml"
|
||||
```
|
||||
|
||||
The swagger document for Apiary project `bomapi3` was saved as local file `./swagger.yaml`.
|
||||
|
||||
> See [Fetching Published Documentation](https://help.apiary.io/tools/apiary-cli/#fetching-published-documentation).
|
||||
|
||||
3. The host \(address\) of the service being tested
|
||||
2. The host \(address\) of the service being tested
|
||||
|
||||
```text
|
||||
$ export API_HOST=http://deheremap7336.emea.adsint.biz:8004`
|
||||
@@ -84,10 +42,10 @@ To test an API within the CI environment provisioned as mentioned in the environ
|
||||
|
||||
### Running the Test
|
||||
|
||||
With all of the above \(`APIARY_API_KEY`, `APIARY_API_NAME`, `API_HOST`, set up and `swagger.yaml` file present in the current directory\), run:
|
||||
Run:
|
||||
|
||||
```text
|
||||
$ dredd swagger.yaml $API_HOST -r apiary
|
||||
$ dredd swagger.yaml $API_HOST
|
||||
```
|
||||
|
||||
> See [Dredd Command-line Interface](https://dredd.readthedocs.io/en/latest/usage-cli/).
|
||||
@@ -98,5 +56,4 @@ The Dredd will perform the tests and exits usually if the tests have passed. You
|
||||
$ echo $?
|
||||
```
|
||||
|
||||
Everything else but `0` should break the build. The test results will be visible in the CLI \(log\) as well as in Apiary.
|
||||
|
||||
Everything else but `0` should break the build. The test results will be visible in the CLI \(log\)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Complete API Development
|
||||
|
||||
> NOTE: The content of this file is outdated, refering to previous technologies used at adidas. It is kept for reference until its refresh
|
||||
|
||||
1. **Design the API**
|
||||
1. Analyze business requirements
|
||||
2. Identify affordances
|
||||
|
||||
Reference in New Issue
Block a user