forked from znsio/specmatic-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting started now uses openapi instead of spec file
- Loading branch information
1 parent
c6e9f9a
commit a122aa0
Showing
3 changed files
with
45 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,37 @@ | ||
Copy paste below text into a file with name "service.spec". This, as you can see, uses the Gherkin syntax to describe a basic GET request. | ||
Copy paste below text into a file with name "service.yaml". This, as you can see, uses the Gherkin syntax to describe a basic GET request. | ||
|
||
Feature: Contract for the petstore service | ||
|
||
Scenario: Should be able to get a pet by petId | ||
When GET /pets/(petid:number) | ||
Then status 200 | ||
And response-body {petid: "(number)"} | ||
|
||
There are some extra keywords that make it easier to define APIs. | ||
* GET and related URL | ||
* status | ||
* response-body | ||
* (number) - placeholder for number datatype | ||
|
||
These keywords are documented in the contract syntax reference. TODO | ||
--- | ||
openapi: "3.0.1" | ||
info: | ||
title: "Contract for the petstore service" | ||
version: "1" | ||
paths: | ||
/pets/{petid}: | ||
get: | ||
summary: "Should be able to get a pet by petId" | ||
parameters: | ||
- name: "petid" | ||
in: "path" | ||
required: true | ||
schema: | ||
type: "number" | ||
responses: | ||
"200": | ||
description: "Should be able to get a pet by petId" | ||
content: | ||
application/json: | ||
schema: | ||
required: | ||
- "id" | ||
- "name" | ||
- "status" | ||
- "type" | ||
properties: | ||
id: | ||
type: "number" | ||
name: | ||
type: "string" | ||
type: | ||
type: "string" | ||
status: | ||
type: "string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters