Skip to content

Commit

Permalink
added postman api integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper-NS committed Nov 17, 2023
1 parent 185e985 commit 02a74a3
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/postman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ on:
branches: [ master ]

jobs:
start-api:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run API
run: dotnet run --project CentralHub.Api/CentralHub.Api.csproj

automated-api-tests:
runs-on: ubuntu-latest
steps:
Expand All @@ -25,4 +18,4 @@ jobs:
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run API tests
run: |
postman collection run "31208196-ebe740bc-2741-48ef-bdb6-e9ad85e8d39a"
postman collection run "31208196-ebe740bc-2741-48ef-bdb6-e9ad85e8d39a" --reporters cli,junit --global-var api_url=http://localhost:8081
4 changes: 4 additions & 0 deletions .postman/api
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
apis[] = {"apiId":"73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2"}
configVersion = 1.0.0
type = api
20 changes: 20 additions & 0 deletions .postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
configVersion = 1.1.0
type = apiEntityData

[config]
id = 73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2

[config.relations]

[config.relations.collections]
rootDirectory = postman/collections

[config.relations.collections.metaData]

[config.relations.apiDefinition]
files[] = {"path":"index.json","metaData":{}}

[config.relations.apiDefinition.metaData]
type = openapi:3
rootFiles[] = index.json
119 changes: 119 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Sample API",
"description": "Buy or rent spacecrafts"
},
"paths": {
"/spacecrafts/{spacecraftId}": {
"parameters": [
{
"name": "spacecraftId",
"description": "The unique identifier of the spacecraft",
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/SpacecraftId"
}
}
],
"get": {
"summary": "Read a spacecraft",
"responses": {
"200": {
"description": "The spacecraft corresponding to the provided `spacecraftId`",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Spacecraft"
}
}
}
},
"404": {
"description": "No spacecraft found for the provided `spacecraftId`",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"SpacecraftId": {
"description": "The unique identifier of a spacecraft",
"type": "string"
},
"Spacecraft": {
"type": "object",
"required": [
"id",
"name",
"type"
],
"properties": {
"id": {
"$ref": "#/components/schemas/SpacecraftId"
},
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"capsule",
"probe",
"satellite",
"spaceplane",
"station"
]
},
"description": {
"type": "string"
}
}
},
"Error": {
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"description": "A human readable error message",
"type": "string"
}
}
}
},
"securitySchemes": {
"ApiKey": {
"type": "apiKey",
"in": "header",
"name": "X-Api-Key"
}
}
},
"security": [
{
"ApiKey": []
}
]
}

0 comments on commit 02a74a3

Please sign in to comment.