Skip to content

Commit

Permalink
feat: adding a server variables example
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed May 12, 2021
1 parent 2d54a4a commit fe6d05b
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
47 changes: 47 additions & 0 deletions 3.0/json/server-variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"openapi": "3.0.3",
"info": {
"title": "Server variables",
"description": "https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#serverVariableObject",
"version": "1.0.0"
},
"servers": [
{
"url": "https://{name}.example.com:{port}/{basePath}",
"variables": {
"name": {
"default": "demo"
},
"port": {
"default": "443"
},
"basePath": {
"default": "v2"
}
}
},
{
"url": "http://{name}.local/{basePath}",
"variables": {
"name": {
"default": "demo"
},
"basePath": {
"default": "v2"
}
}
}
],
"paths": {
"/": {
"post": {
"summary": "Should fetch variables from defaults and user values",
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
}
27 changes: 27 additions & 0 deletions 3.0/yaml/server-variables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
openapi: 3.0.3
info:
title: Server variables
description: 'https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#serverVariableObject'
version: 1.0.0
servers:
- url: 'https://{name}.example.com:{port}/{basePath}'
variables:
name:
default: demo
port:
default: '443'
basePath:
default: v2
- url: 'http://{name}.local/{basePath}'
variables:
name:
default: demo
basePath:
default: v2
paths:
/:
post:
summary: Should fetch variables from defaults and user values
responses:
'200':
description: OK

0 comments on commit fe6d05b

Please sign in to comment.