Skip to content

Commit 86569f8

Browse files
committed
better swaggerhub api mocking explaination
1 parent 4086784 commit 86569f8

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ decoupling HTTP tests with the library being used for HTTP calls.
4141

4242
- Local : [docs/openapi.yml](docs/openapi.yml)
4343
- Github Pages : https://jmlamodiere.github.io/tdd-demo-forumphp2020
44-
- Swaggger Hub (with online mock) : https://app.swaggerhub.com/apis/JMLamodiere/tdd-demo_forum_php_2020/1.0.0
44+
- Swaggger Hub (with [SwaggerHub API Auto Mocking](https://app.swaggerhub.com/help/integrations/api-auto-mocking)
45+
activated) : https://app.swaggerhub.com/apis/JMLamodiere/tdd-demo_forum_php_2020/1.0.0
46+
47+
Example :
48+
49+
curl -i -X PUT "https://virtserver.swaggerhub.com/JMLamodiere/tdd-demo_forum_php_2020/1.0.0/runningsessions/42" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"id\":42,\"distance\":5.5,\"shoes\":\"Adadis Turbo2\"}"
4550

4651
## Makefile
4752

@@ -77,12 +82,6 @@ make start
7782
- Symfony homepage (404): https://127.0.0.1:8000/
7883
- Symfony profiler: https://127.0.0.1:8000/_profiler/
7984

80-
### SwaggerHub mock server
81-
82-
An online mock server is auto-generated based on openapi doc at https://virtserver.swaggerhub.com/JMLamodiere/tdd-demo_forum_php_2020/1.0.0 . Example :
83-
84-
curl -i -X PUT "https://virtserver.swaggerhub.com/JMLamodiere/tdd-demo_forum_php_2020/1.0.0/runningsessions/42" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"id\":42,\"distance\":5.5,\"shoes\":\"Adadis Turbo2\"}"
85-
8685
## Postgresql
8786

8887
To access Postgresql database, configure a tool such as

docs/openapi.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ info:
44
description: |
55
See [JMLamodiere/tdd-demo-forumphp2020](https://github.com/JMLamodiere/tdd-demo-forumphp2020/blob/main/README.md) on GitHub.
66
7+
To call [SwaggerHub API Auto Mocking](https://app.swaggerhub.com/help/integrations/api-auto-mocking) urls,
8+
choose `virtserver.swaggerhub.com` in `Servers` list
9+
710
version: 1.0.0
811

912
# See https://swagger.io/docs/specification/paths-and-operations/
@@ -62,7 +65,8 @@ components:
6265
required: [ temperatureCelcius ]
6366
properties:
6467
temperatureCelcius:
65-
type: float
68+
type: number
69+
format: float
6670
example: 37.2
6771

6872
RunningSessionId:

0 commit comments

Comments
 (0)