Fixing the import bug, adding integration tests

This commit is contained in:
Varad Meru [gmail] 2020-09-13 16:24:47 -07:00
Родитель 4b8e0a34eb
Коммит 69a9665917
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: D65E2959EB74910D
181 изменённых файлов: 37065 добавлений и 82 удалений

Просмотреть файл

@ -1,4 +1,4 @@
# OpenAPI Code Generator for Azure Functions
# OpenAPI Code Generator for Azure Functions (Python)
## (part of project-stencil)
### Autorest plugin configuration

Просмотреть файл

@ -4,4 +4,4 @@
# license information.
# --------------------------------------------------------------------------
VERSION = "0.0.1-preview"
VERSION = "0.1.0-preview"

Просмотреть файл

@ -4,14 +4,20 @@
# license information.
# --------------------------------------------------------------------------
from jinja2 import Environment
from autorest.codegen import CodeModel, OperationGroup
from autorest.codegen.models import FileImport, ImportType
from autorest.codegen.serializers.azure_functions.common import prettify_json
from autorest.codegen.serializers.azure_functions.python.import_serializer import FileImportSerializer
from autorest.codegen.serializers.azure_functions.python.trigger_serializer import InputTriggerSerializer
from autorest.codegen.serializers.azure_functions.python.bindings_serializer import OutputBindingsSerializer
from autorest.codegen.serializers.azure_functions.python.bindings_serializer \
import \
OutputBindingsSerializer
from autorest.codegen.serializers.azure_functions.python.import_serializer \
import \
FileImportSerializer
from autorest.codegen.serializers.azure_functions.python.trigger_serializer \
import \
InputTriggerSerializer
class HttpFunctionsSerializer(object):
@ -39,10 +45,7 @@ class HttpFunctionsSerializer(object):
request_comment_description="Passing the request",
return_comment_description="Request",
magic_comment="### Do Magic Here! ###",
imports=FileImportSerializer(
self.operation_group.imports(self.async_mode, bool(self.code_model.schemas)),
is_python_3_file=self.async_mode
),
imports=FileImportSerializer(self._get_imports()),
success_status_code="200",
failure_status_code="405"
)
@ -50,7 +53,20 @@ class HttpFunctionsSerializer(object):
def serialize_functions_json_file(self, operation):
template = self.env.get_template("functions.json.jinja2")
return prettify_json(template.render(script_filename=self.default_script_filename,
input_trigger=InputTriggerSerializer(operation, self.env),
output_bindings=[OutputBindingsSerializer(operation, self.env)],
is_disabled=False))
return prettify_json(
template.render(script_filename=self.default_script_filename,
input_trigger=InputTriggerSerializer(operation,
self.env),
output_bindings=[
OutputBindingsSerializer(operation, self.env)],
is_disabled=False))
@staticmethod
def _get_imports():
file_import = FileImport()
file_import.add_from_import("azure.functions", "HttpRequest",
ImportType.THIRDPARTY)
file_import.add_from_import("azure.functions", "HttpResponse",
ImportType.THIRDPARTY)
file_import.add_import("logging", ImportType.STDLIB)
return file_import

Просмотреть файл

@ -39,7 +39,8 @@ def _get_import_clauses(imports: Dict[ImportType, Dict[str, Set[Optional[str]]]]
class FileImportSerializer:
def __init__(self, file_import: FileImport, is_python_3_file: bool) -> None:
def __init__(self, file_import: FileImport,
is_python_3_file: bool = True) -> None:
self._file_import = file_import
self.is_python_3_file = is_python_3_file

Просмотреть файл

@ -2,7 +2,7 @@
tox
invoke
colorama
pylint==2.5.3
pylint
pytest
ptvsd
mypy

Просмотреть файл

@ -9,19 +9,19 @@ trigger:
branches:
include:
- dev
- master
- main
- release/*
pr:
branches:
include:
- dev
- master
- main
variables:
NodeVersion: '12.x'
PythonVersion: '3.6'
TestFolder: '$(Build.SourcesDirectory)/test/'
NodeVersion: '12.x'
pythonVersion: '3.8'
schedules:
- cron: "0 8 * * 1,2,3,4"
@ -29,7 +29,7 @@ schedules:
branches:
include:
- dev
- master
- main
- release/*
exclude:
- releases/ancient/*
@ -40,18 +40,12 @@ jobs:
strategy:
matrix:
Linux_Python36:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
PythonVersion: '3.6'
Python38:
pythonVersion: '$(pythonVersion)'
CoverageArg: ''
Linux_Python38:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
PythonVersion: '3.8'
pool:
vmImage: '$(OSVmImage)'
vmImage: 'ubuntu-18.04'
steps:
- task: NodeTool@0
@ -60,72 +54,40 @@ jobs:
versionSpec: '$(NodeVersion)'
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: 3.6
versionSpec: '3.8'
addToPath: true
- task: DockerInstaller@0
displayName: Docker Installer
inputs:
dockerVersion: 17.09.0-ce
releaseType: stable
- script: |
cd $(Build.SourcesDirectory)
pip install --upgrade pip
pip install -r dev_requirements.txt
npm install -g autorest
npm install
# npm install -g autorest
npm install -g bats
displayName: 'Prepare Environment for Generation'
- script: |
pylint autorest
displayName: 'Pylint'
continueOnError: true
- script: |
mypy autorest
displayName: 'Mypy'
continueOnError: true
- script: |
pytest --instafail --cov=./autorest --cov-report xml --cov-branch test/unittests
displayName: 'Unit tests'
continueOnError: true
- script: |
inv regenerate
displayName: 'Regenerate Code'
- script: |
git add -A # 'add' first so 'diff' includes untracked files
git diff --staged -w
displayName: 'Diff regeneration'
- task: UsePythonVersion@0
displayName: 'Use Python $(PythonVersion)'
inputs:
versionSpec: $(PythonVersion)
- script: |
pip install tox coverage==4.5.4
displayName: 'Install Env Specific Reqs in Target PyVersion $(PythonVersion)'
- script: |
cd $(TestFolder)/azure
tox -e ci
displayName: 'Execute "azure" Tests - Python $(PythonVersion)'
- task: PublishTestResults@2
bats $(TestFolder)/integrationtests/tests/
displayName: 'Run integration tests using bats'
condition: always()
displayName: 'Publish "azure" Test Results'
inputs:
testResultsFiles: 'test-junit-azure-ci.xml'
testRunTitle: '$(OSName) Python $(PythonVersion) - azure'
searchFolder: '$(TestFolder)/azure'
- script: |
cd $(TestFolder)/vanilla
tox -e ci
displayName: 'Execute "vanilla" Tests - Python $(PythonVersion)'
- task: PublishTestResults@2
displayName: 'Publish "vanilla" Test Results'
condition: always()
inputs:
testResultsFiles: 'test-junit-vanilla-ci.xml'
testRunTitle: '$(OSName) Python $(PythonVersion) - vanilla'
searchFolder: '$(TestFolder)/vanilla'
- script: |
npm run coverage-push -- $(Build.Repository.Name) $(Build.SourceBranch) $(github-token) $(storage-coverage-user) $(storage-coverage-pass)
workingDirectory: node_modules/@microsoft.azure/autorest.testserver
displayName: 'Publish coverage report to stroage account'

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@autorest/azure-functions-python",
"version": "0.0.1-preview",
"version": "0.1.0-preview",
"description": "The Azure Functions extension for code generators in AutoRest.",
"scripts": {
"prepare": "node run-python3.js prepare.py",

33
test.Dockerfile Normal file
Просмотреть файл

@ -0,0 +1,33 @@
# Test docker file which is based on Functions image.
FROM mcr.microsoft.com/azure-functions/python:3.0-python3.7
# FROM python:3.8-buster
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y gnupg wget unzip git curl ca-certificates dirmngr apt-transport-https \
lsb-release openssl apt-utils coreutils make gcc g++ grep make util-linux \
binutils findutils vim python3-venv python3-pip && \
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get -y install nodejs && \
npm install -g autorest && \
npm install -g @azure-tools/extension
RUN mkdir /home/autorest.azure-functions-python
COPY . /home/autorest.azure-functions-python
RUN rm -r /home/autorest.azure-functions-python/venv && \
mkdir -p /home/site/wwwroot && \
cd /home/autorest.azure-functions-python && \
npm install --unsafe-perm
# RUN cd /home/autorest.azure-functions-python && \
# npm install --unsafe-perm && \
# python install.py
# COPY . /home/site/wwwroot
# RUN
CMD [ "/azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost" ]

Просмотреть файл

@ -0,0 +1,741 @@
{
"swagger": "2.0",
"info": {
"description": "This is a sample Consoto server specification.",
"version": "1.0.0",
"title": "Contoso HR",
"termsOfService": "http://find.terms.of.service.here/",
"contact": {
"email": "apiteam@contoso.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "contoso.com",
"basePath": "/hr/api/v1.0.0",
"tags": [
{
"name": "Employee",
"description": "Operations about employees",
"externalDocs": {
"description": "Find out more",
"url": "http://contoso.com"
}
},
{
"name": "Organization",
"description": "Operations about organization"
},
{
"name": "Role",
"description": "Operations about roles",
"externalDocs": {
"description": "Find out more about our Company",
"url": "http://contoso.com"
}
}
],
"schemes": [
"https"
],
"paths": {
"/employee": {
"post": {
"tags": [
"Employee"
],
"summary": "Add a new employee to database",
"operationId": "addEmployee",
"consumes": [
"application/json",
"application/xml"
],
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "Employee object that needs to be added to the Company",
"required": true,
"schema": {
"$ref": "#/definitions/Employee"
}
}
],
"responses": {
"405": {
"description": "Invalid input"
}
},
"security": [
{
"EmployeeCompany_auth": [
"write:employees",
"read:employees"
]
}
]
},
"get": {
"tags": [
"Employee"
],
"summary": "Returns all Employees",
"description": "Returns an array of employee",
"operationId": "getEmployees",
"produces": [
"application/json"
],
"parameters": [],
"responses": {
"200": {
"description": "Here's the list of employees",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Employee"
}
}
}
},
"security": [
{
"api_key": []
}
]
}
},
"/employee/findByRole": {
"get": {
"tags": [
"Employee"
],
"summary": "Finds Employees by role",
"description": "Multiple role values can be provided with comma separated strings",
"operationId": "findEmployeesByRole",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "role",
"in": "query",
"description": "Role values that need to be considered for filter",
"required": true,
"type": "array",
"items": {
"type": "string",
"default": "Software Engineer"
},
"collectionFormat": "multi"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Employee"
}
}
},
"400": {
"description": "Invalid status value"
}
},
"security": [
{
"EmployeeCompany_auth": [
"write:employees",
"read:employees"
]
}
]
}
},
"/employee/{employeeId}": {
"get": {
"tags": [
"Employee"
],
"summary": "Find Employee by ID",
"description": "Returns a single Employee",
"operationId": "getEmployeeById",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "employeeId",
"in": "path",
"description": "ID of Employee to return",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/Employee"
}
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Employee not found"
}
},
"security": [
{
"api_key": []
}
]
},
"put": {
"tags": [
"Employee"
],
"summary": "Updates a Employee in the Company with form data",
"operationId": "updateEmployeeWithForm",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "employeeId",
"in": "path",
"description": "ID of Employee that needs to be updated",
"required": true,
"type": "string",
"format": "uuid"
},
{
"name": "name",
"in": "formData",
"description": "Updated name of the Employee",
"required": false,
"type": "string"
},
{
"name": "role",
"in": "formData",
"description": "Updated role of the Employee",
"required": false,
"type": "string"
}
],
"responses": {
"405": {
"description": "Invalid input"
}
},
"security": [
{
"EmployeeCompany_auth": [
"write:employees",
"read:employees"
]
}
]
},
"delete": {
"tags": [
"Employee"
],
"summary": "Deletes a Employee",
"operationId": "deleteEmployee",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "api_key",
"in": "header",
"required": false,
"type": "string"
},
{
"name": "employeeId",
"in": "path",
"description": "Employee id to delete",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Employee not found"
}
},
"security": [
{
"EmployeeCompany_auth": [
"write:employees",
"read:employees"
]
}
]
}
},
"/employee/{employeeId}/uploadImage": {
"put": {
"tags": [
"Employee"
],
"summary": "uploads an image",
"operationId": "uploadFile",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "employeeId",
"in": "path",
"description": "ID of Employee to update",
"required": true,
"type": "string",
"format": "uuid"
},
{
"name": "additionalMetadata",
"in": "formData",
"description": "Additional data to pass to server",
"required": false,
"type": "string"
},
{
"name": "file",
"in": "formData",
"description": "file to upload",
"required": false,
"type": "file"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/ApiResponse"
}
}
},
"security": [
{
"EmployeeCompany_auth": [
"write:employees",
"read:employees"
]
}
]
}
},
"/organization": {
"get": {
"tags": [
"Organization"
],
"summary": "Returns all Organization details",
"description": "Returns an array of organization",
"operationId": "getOrganizations",
"produces": [
"application/json"
],
"parameters": [],
"responses": {
"200": {
"description": "Here's the list of organization",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Organization"
}
}
}
},
"security": [
{
"api_key": []
}
]
},
"post": {
"tags": [
"Organization"
],
"summary": "Add a new Organization to database",
"operationId": "addOrganization",
"consumes": [
"application/json",
"application/xml"
],
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "Organization object that needs to be added to the Company",
"required": true,
"schema": {
"$ref": "#/definitions/Organization"
}
}
],
"responses": {
"405": {
"description": "Invalid input"
}
},
"security": [
{
"EmployeeCompany_auth": [
"write:employees",
"read:employees"
]
}
]
}
},
"/organization/{organizationId}": {
"get": {
"tags": [
"Organization"
],
"summary": "Returns a specfic Organization's details",
"description": "Returns an organization",
"operationId": "getOrganization",
"produces": [
"application/json"
],
"parameters": [
{
"name": "organizationId",
"in": "path",
"description": "ID of organization to return",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "Here are the details of the organization",
"schema": {
"$ref": "#/definitions/Organization"
}
}
},
"security": [
{
"api_key": []
}
]
},
"put": {
"tags": [
"Organization"
],
"summary": "Update details of an organization",
"operationId": "updateOrganization",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "organizationId",
"in": "path",
"description": "ID of organization to return",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/Organization"
}
},
"400": {
"description": "Invalid Organization operation"
}
}
}
},
"/role": {
"post": {
"tags": [
"Role"
],
"summary": "Create Role",
"description": "Create a new role.",
"operationId": "createRole",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "Created role object",
"required": true,
"schema": {
"$ref": "#/definitions/Role"
}
}
],
"responses": {
"default": {
"description": "successful operation"
}
}
},
"get": {
"tags": [
"Role"
],
"summary": "Get all Roles",
"description": "Get all roles.",
"operationId": "getRoles",
"produces": [
"application/json",
"application/xml"
],
"parameters": [],
"responses": {
"200": {
"description": "Here's the list of all roles",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Role"
}
}
},
"default": {
"description": "successful operation"
}
}
}
},
"/role/{roleId}": {
"put": {
"tags": [
"Role"
],
"summary": "update Role Information",
"operationId": "updateRole",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "roleId",
"in": "path",
"description": "ID of Role to update",
"required": true,
"type": "string",
"format": "uuid"
},
{
"in": "body",
"name": "body",
"description": "Update of role object",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Role"
}
}
}
],
"responses": {
"default": {
"description": "successful operation"
}
}
},
"get": {
"tags": [
"Role"
],
"summary": "update Role Information",
"operationId": "getRole",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "roleId",
"in": "path",
"description": "ID of Role to return",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"default": {
"description": "successful operation"
}
}
}
}
},
"securityDefinitions": {
"contosohr_auth": {
"type": "oauth2",
"authorizationUrl": "http://contoso.com/oauth/dialog",
"flow": "implicit",
"scopes": {
"write:employees": "modify employee records in your account",
"read:employees": "read employee records"
}
},
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header"
}
},
"definitions": {
"Organization": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"Name": {
"type": "string",
"example": "Cloud and AI"
},
"active": {
"type": "boolean",
"default": true
}
},
"xml": {
"name": "Organization"
}
},
"Role": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"Name": {
"type": "string",
"example": "Software Engineer"
},
"active": {
"type": "boolean",
"default": true
}
},
"xml": {
"name": "Role"
}
},
"Employee": {
"type": "object",
"required": [
"name",
"role"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string",
"example": "John Doe"
},
"role": {
"$ref": "#/definitions/Role"
},
"organization": {
"$ref": "#/definitions/Organization"
},
"date-of-birth": {
"type": "string",
"format": "date-time"
},
"date-of-joining": {
"type": "string",
"format": "date-time"
},
"active": {
"type": "boolean",
"default": true
},
"photoUrls": {
"type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
},
"items": {
"type": "string"
}
}
},
"xml": {
"name": "Employee"
}
},
"ApiResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"type": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
},
"externalDocs": {
"description": "Find out more about Contoso",
"url": "http://contoso.com"
}
}

Просмотреть файл

@ -0,0 +1,516 @@
{
"swagger": "2.0",
"info": {
"title": "COVIDScreeningApi",
"version": "1.0"
},
"schemes": [
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"paths": {
"/PortsOfEntry": {
"get": {
"operationId": "get-portsofentry",
"summary": "/PortsOfEntry - GET",
"tags": [
"PortsOfEntry"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/PortsOfEntryArray"
}
}
}
},
"post": {
"operationId": "post-portsofentry",
"summary": "/PortsOfEntry - POST",
"tags": [
"PortsOfEntry"
],
"parameters": [
{
"name": "portsOfEntry",
"in": "body",
"schema": {
"$ref": "#/definitions/PortsOfEntry"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/*+json"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/PortsOfEntry"
}
}
}
}
},
"/PortsOfEntry/{id}": {
"get": {
"operationId": "get-portsofentry-id",
"summary": "/PortsOfEntry/{id} - GET",
"tags": [
"PortsOfEntry"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "Format - uuid.",
"required": true,
"type": "string"
}
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/PortsOfEntry"
}
}
}
},
"put": {
"operationId": "put-portsofentry-id",
"summary": "/PortsOfEntry/{id} - PUT",
"tags": [
"PortsOfEntry"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "Format - uuid.",
"required": true,
"type": "string"
},
{
"name": "portsOfEntry",
"in": "body",
"schema": {
"$ref": "#/definitions/PortsOfEntry"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/*+json"
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/RepresentativeData": {
"get": {
"operationId": "get-representativedata",
"summary": "/RepresentativeData - GET",
"tags": [
"RepresentativeData"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/RepresentativeDataArray"
}
}
}
},
"post": {
"operationId": "post-representativedata",
"summary": "/RepresentativeData - POST",
"tags": [
"RepresentativeData"
],
"parameters": [
{
"name": "representativeData",
"in": "body",
"schema": {
"$ref": "#/definitions/RepresentativeData"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/*+json"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/RepresentativeData"
}
}
}
}
},
"/RepresentativeData/{id}": {
"get": {
"operationId": "get-representativedata-id",
"summary": "/RepresentativeData/{id} - GET",
"tags": [
"RepresentativeData"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "Format - uuid.",
"required": true,
"type": "string"
}
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/RepresentativeData"
}
}
}
},
"put": {
"operationId": "put-representativedata-id",
"summary": "/RepresentativeData/{id} - PUT",
"tags": [
"RepresentativeData"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "Format - uuid.",
"required": true,
"type": "string"
},
{
"name": "representativeData",
"in": "body",
"schema": {
"$ref": "#/definitions/RepresentativeData"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/*+json"
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/ScreeningDataTable": {
"get": {
"operationId": "get-screeningdatatable",
"summary": "/ScreeningDataTable - GET",
"tags": [
"ScreeningDataTable"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/ScreeningDataTableArray"
}
}
}
},
"post": {
"operationId": "post-screeningdatatable",
"summary": "/ScreeningDataTable - POST",
"tags": [
"ScreeningDataTable"
],
"parameters": [
{
"name": "screeningDataTable",
"in": "body",
"schema": {
"$ref": "#/definitions/ScreeningDataTable"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/*+json"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/ScreeningDataTable"
}
}
}
}
},
"/ScreeningDataTable/{id}": {
"get": {
"operationId": "get-screeningdatatable-id",
"summary": "/ScreeningDataTable/{id} - GET",
"tags": [
"ScreeningDataTable"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "Format - uuid.",
"required": true,
"type": "string"
}
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/ScreeningDataTable"
}
}
}
},
"put": {
"operationId": "put-screeningdatatable-id",
"summary": "/ScreeningDataTable/{id} - PUT",
"tags": [
"ScreeningDataTable"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "Format - uuid.",
"required": true,
"type": "string"
},
{
"name": "screeningDataTable",
"in": "body",
"schema": {
"$ref": "#/definitions/ScreeningDataTable"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/*+json"
],
"responses": {
"200": {
"description": "Success"
}
}
}
}
},
"definitions": {
"PortsOfEntry": {
"type": "object",
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"itemsLabels": {
"type": "string"
},
"itemsLongitudes": {
"format": "double",
"type": "number"
},
"itemsLatitudes": {
"format": "double",
"type": "number"
}
}
},
"RepresentativeData": {
"type": "object",
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"repName": {
"type": "string"
},
"repContact": {
"type": "string"
},
"repLocation": {
"type": "string"
},
"repEmail": {
"type": "string"
}
}
},
"ScreeningDataTable": {
"type": "object",
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"visitorName": {
"type": "string"
},
"location": {
"type": "string"
},
"screeningRepName": {
"type": "string"
},
"passport": {
"type": "string"
},
"contactNumber": {
"type": "string"
},
"nationality": {
"type": "string"
},
"dateOfScreening": {
"format": "date-time",
"type": "string"
},
"fever": {
"type": "boolean"
},
"soreThroat": {
"type": "boolean"
},
"runnyNose": {
"type": "boolean"
},
"fatigue": {
"type": "boolean"
},
"headache": {
"type": "boolean"
},
"bodyache": {
"type": "boolean"
},
"shortnessOfBreath": {
"type": "boolean"
},
"dryCough": {
"type": "boolean"
},
"traveledOutsideTheUS": {
"type": "boolean"
},
"inContactWithCOVID": {
"type": "boolean"
}
}
},
"PortsOfEntryArray": {
"type": "array",
"items": {
"$ref": "#/definitions/PortsOfEntry"
}
},
"RepresentativeDataArray": {
"type": "array",
"items": {
"$ref": "#/definitions/RepresentativeData"
}
},
"ScreeningDataTableArray": {
"type": "array",
"items": {
"$ref": "#/definitions/ScreeningDataTable"
}
}
},
"tags": [],
"host": "covidscreening-app-apis.azure-api.net"
}

Просмотреть файл

@ -0,0 +1,177 @@
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Swagger Petstore",
"license": {
"name": "MIT"
}
},
"servers": [
{
"url": "http://petstore.swagger.io/v1"
}
],
"paths": {
"/pets": {
"get": {
"summary": "List all pets",
"operationId": "listPets",
"tags": [
"pets"
],
"parameters": [
{
"name": "limit",
"in": "query",
"description": "How many items to return at one time (max 100)",
"required": false,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "A paged array of pets",
"headers": {
"x-next": {
"description": "A link to the next page of responses",
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pets"
}
}
}
},
"default": {
"description": "unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"post": {
"summary": "Create a pet",
"operationId": "createPets",
"tags": [
"pets"
],
"responses": {
"201": {
"description": "Null response"
},
"default": {
"description": "unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/pets/{petId}": {
"get": {
"summary": "Info for a specific pet",
"operationId": "showPetById",
"tags": [
"pets"
],
"parameters": [
{
"name": "petId",
"in": "path",
"required": true,
"description": "The id of the pet to retrieve",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Expected response to a valid request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
},
"default": {
"description": "unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Pet": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"Pets": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Pet"
}
},
"Error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,111 @@
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
get:
summary: List all pets
operationId: listPets
tags:
- pets
parameters:
- name: limit
in: query
description: How many items to return at one time (max 100)
required: false
schema:
type: integer
format: int32
responses:
'200':
description: A paged array of pets
headers:
x-next:
description: A link to the next page of responses
schema:
type: string
content:
application/json:
schema:
$ref: "#/components/schemas/Pets"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
summary: Create a pet
operationId: createPets
tags:
- pets
responses:
'201':
description: Null response
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/pets/{petId}:
get:
summary: Info for a specific pet
operationId: showPetById
tags:
- pets
parameters:
- name: petId
in: path
required: true
description: The id of the pet to retrieve
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Pet"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
Pets:
type: array
items:
$ref: "#/components/schemas/Pet"
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string

Просмотреть файл

@ -1,5 +1,6 @@
{
"swagger": "2.0",
"host": "petstore-test.com",
"info": {
"description": "This is a sample server Petstore server. You can find \nout more about Swagger at \n[http://swagger.io](http://swagger.io) or on \n[irc.freenode.net, #swagger](http://swagger.io/irc/).\n",
"version": "1.0.0",

Просмотреть файл

@ -0,0 +1,343 @@
{
"swagger": "2.0",
"info": {
"title": "AdditionalPropertiesClient",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/additionalProperties/true": {
"put": {
"operationId": "Pets_CreateAPTrue",
"description": "Create a Pet which contains more properties than what is defined.",
"parameters": [
{
"name": "createParameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PetAPTrue"
}
}
],
"responses": {
"200": {
"description": "A Pet which contains more properties than what is defined.",
"schema": {
"$ref": "#/definitions/PetAPTrue"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/additionalProperties/true-subclass": {
"put": {
"operationId": "Pets_CreateCatAPTrue",
"description": "Create a CatAPTrue which contains more properties than what is defined.",
"parameters": [
{
"name": "createParameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CatAPTrue"
}
}
],
"responses": {
"200": {
"description": "A CatAPTrue which contains more properties than what is defined.",
"schema": {
"$ref": "#/definitions/CatAPTrue"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/additionalProperties/type/object": {
"put": {
"operationId": "Pets_CreateAPObject",
"description": "Create a Pet which contains more properties than what is defined.",
"parameters": [
{
"name": "createParameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PetAPObject"
}
}
],
"responses": {
"200": {
"description": "A Pet which contains more properties than what is defined.",
"schema": {
"$ref": "#/definitions/PetAPObject"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/additionalProperties/type/string": {
"put": {
"operationId": "Pets_CreateAPString",
"description": "Create a Pet which contains more properties than what is defined.",
"parameters": [
{
"name": "createParameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PetAPString"
}
}
],
"responses": {
"200": {
"description": "A Pet which contains more properties than what is defined.",
"schema": {
"$ref": "#/definitions/PetAPString"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/additionalProperties/in/properties": {
"put": {
"operationId": "Pets_CreateAPInProperties",
"description": "Create a Pet which contains more properties than what is defined.",
"parameters": [
{
"name": "createParameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PetAPInProperties"
}
}
],
"responses": {
"200": {
"description": "A Pet which contains more properties than what is defined.",
"schema": {
"$ref": "#/definitions/PetAPInProperties"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/additionalProperties/in/properties/with/additionalProperties/string": {
"put": {
"operationId": "Pets_CreateAPInPropertiesWithAPString",
"description": "Create a Pet which contains more properties than what is defined.",
"parameters": [
{
"name": "createParameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/PetAPInPropertiesWithAPString"
}
}
],
"responses": {
"200": {
"description": "A Pet which contains more properties than what is defined.",
"schema": {
"$ref": "#/definitions/PetAPInPropertiesWithAPString"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
},
"PetAPTrue": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"status": {
"type": "boolean",
"readOnly": true
}
},
"additionalProperties": true
},
"CatAPTrue": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/PetAPTrue"
}
],
"properties": {
"friendly": {
"type": "boolean"
}
}
},
"PetAPObject": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"status": {
"type": "boolean",
"readOnly": true
}
},
"additionalProperties": {
"type": "object"
}
},
"PetAPString": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"status": {
"type": "boolean",
"readOnly": true
}
},
"additionalProperties": {
"type": "string"
}
},
"PetAPInProperties": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"status": {
"type": "boolean",
"readOnly": true
},
"additionalProperties": {
"type": "object",
"additionalProperties": {
"type": "number"
}
}
}
},
"PetAPInPropertiesWithAPString": {
"type": "object",
"required": [
"id",
"@odata.location"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"status": {
"type": "boolean",
"readOnly": true
},
"@odata.location": {
"type": "string"
},
"additionalProperties": {
"type": "object",
"additionalProperties": {
"type": "number"
}
}
},
"additionalProperties": {
"type": "string"
}
}
}
}

Просмотреть файл

@ -0,0 +1,231 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Parameter Grouping Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/parameterGrouping/postRequired/{path}": {
"post": {
"operationId": "parameterGrouping_postRequired",
"description": "Post a bunch of required parameters grouped",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"type": "integer",
"format": "int32"
},
"required": true,
"x-ms-parameter-grouping": {
}
},
{
"name": "customHeader",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
}
},
{
"name": "query",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
}
},
{
"name": "path",
"in": "path",
"required": true,
"type": "string",
"description": "Path parameter",
"x-ms-parameter-grouping": {
}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/postOptional": {
"post": {
"operationId": "parameterGrouping_postOptional",
"description": "Post a bunch of optional parameters grouped",
"parameters": [
{
"name": "customHeader",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
}
},
{
"name": "query",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/postMultipleParameterGroups": {
"post": {
"operationId": "parameterGrouping_postMultiParamGroups",
"description": "Post parameters from multiple different parameter groups",
"parameters": [
{
"name": "header-one",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
},
{
"name": "query-one",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
},
{
"name": "header-two",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
"postfix": "second-param-group"
}
},
{
"name": "query-two",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
"postfix": "second-param-group"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/parameterGrouping/sharedParameterGroupObject": {
"post": {
"operationId": "parameterGrouping_postSharedParameterGroupObject",
"description": "Post parameters with a shared parameter group object",
"parameters": [
{
"name": "header-one",
"in": "header",
"type": "string",
"required": false,
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
},
{
"name": "query-one",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"default": 30,
"description": "Query parameter with default",
"x-ms-parameter-grouping": {
"name": "first-parameter-group"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,66 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Report Service For Azure",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/report/azure": {
"get": {
"operationId": "getReport",
"description": "Get test coverage report",
"parameters": [
{
"name": "qualifier",
"in": "query",
"required": false,
"type": "string",
"description": "If specified, qualifies the generated report further (e.g. '2.7' vs '3.5' in for Python). The only effect is, that generators that run all tests several times, can distinguish the generated reports."
}
],
"responses": {
"200": {
"description": "The test coverage mapping",
"schema": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,284 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Resource Flattening Test Service",
"description": "Resource Flattening for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/azure/resource-flatten/array": {
"put": {
"operationId": "putArray",
"description": "Put External Resource as an Array",
"externalDocs": {
"url": "http://tempuri.org"
},
"parameters": [
{
"name": "ResourceArray",
"description": "External Resource as an Array to put",
"in": "body",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/ResourceX"
}
}
}
],
"responses": {
"200": {
"description": "Successful Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "getArray",
"description": "Get External Resource as an Array",
"externalDocs": {
"url": "http://tempuri.org"
},
"responses": {
"200": {
"description": "External Resource as an Array from get",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/FlattenedProduct"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azure/resource-flatten/dictionary": {
"put": {
"operationId": "putDictionary",
"description": "Put External Resource as a Dictionary",
"externalDocs": {
"url": "http://tempuri.org"
},
"parameters": [
{
"name": "ResourceDictionary",
"description": "External Resource as a Dictionary to put",
"in": "body",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/FlattenedProduct"
}
}
}
],
"responses": {
"200": {
"description": "Successful Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "getDictionary",
"description": "Get External Resource as a Dictionary",
"externalDocs": {
"url": "http://tempuri.org"
},
"responses": {
"200": {
"description": "External Resource as a Dictionary from get",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/FlattenedProduct"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azure/resource-flatten/resourcecollection": {
"put": {
"operationId": "putResourceCollection",
"description": "Put External Resource as a ResourceCollection",
"externalDocs": {
"url": "http://tempuri.org"
},
"parameters": [
{
"name": "ResourceComplexObject",
"description": "External Resource as a ResourceCollection to put",
"in": "body",
"schema": {
"$ref": "#/definitions/ResourceCollection"
}
}
],
"responses": {
"200": {
"description": "Successful Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "getResourceCollection",
"description": "Get External Resource as a ResourceCollection",
"externalDocs": {
"url": "http://tempuri.org"
},
"responses": {
"200": {
"description": "External Resource as a ResourceCollection from get",
"schema": {
"$ref": "#/definitions/ResourceCollection"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
},
"ResourceX": {
"type": "object",
"x-ms-azure-resource": true,
"description": "Some resource",
"externalDocs": {
"url": "http://tempuri.org"
},
"properties": {
"id": {
"type": "string",
"description": "Resource Id",
"readOnly": true
},
"type": {
"type": "string",
"description": "Resource Type",
"readOnly": true
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"location": {
"type": "string",
"description": "Resource Location"
},
"name": {
"type": "string",
"description": "Resource Name",
"readOnly": true
}
}
},
"FlattenedProduct": {
"allOf": [
{
"$ref": "#/definitions/ResourceX"
}
],
"type": "object",
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/FlattenedResourceProperties"
}
}
},
"FlattenedResourceProperties": {
"type": "object",
"properties": {
"pname": {
"type": "string"
},
"lsize": {
"type": "integer",
"format": "int32"
},
"provisioningState": {
"type": "string"
}
}
},
"ResourceCollection": {
"type": "object",
"properties": {
"productresource": {
"type": "object",
"$ref": "#/definitions/FlattenedProduct"
},
"arrayofresources": {
"type": "array",
"items": {
"$ref": "#/definitions/FlattenedProduct"
}
},
"dictionaryofresources": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/FlattenedProduct"
}
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,284 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Resource Flattening Test Service",
"description": "Resource Flattening for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/azure/resource-flatten/array": {
"put": {
"operationId": "putArray",
"description": "Put External Resource as an Array",
"externalDocs": {
"url": "http://tempuri.org"
},
"parameters": [
{
"name": "ResourceArray",
"description": "External Resource as an Array to put",
"in": "body",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Resource"
}
}
}
],
"responses": {
"200": {
"description": "Successful Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "getArray",
"description": "Get External Resource as an Array",
"externalDocs": {
"url": "http://tempuri.org"
},
"responses": {
"200": {
"description": "External Resource as an Array from get",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/FlattenedProduct"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azure/resource-flatten/dictionary": {
"put": {
"operationId": "putDictionary",
"description": "Put External Resource as a Dictionary",
"externalDocs": {
"url": "http://tempuri.org"
},
"parameters": [
{
"name": "ResourceDictionary",
"description": "External Resource as a Dictionary to put",
"in": "body",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/FlattenedProduct"
}
}
}
],
"responses": {
"200": {
"description": "Successful Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "getDictionary",
"description": "Get External Resource as a Dictionary",
"externalDocs": {
"url": "http://tempuri.org"
},
"responses": {
"200": {
"description": "External Resource as a Dictionary from get",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/FlattenedProduct"
}
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azure/resource-flatten/resourcecollection": {
"put": {
"operationId": "putResourceCollection",
"description": "Put External Resource as a ResourceCollection",
"externalDocs": {
"url": "http://tempuri.org"
},
"parameters": [
{
"name": "ResourceComplexObject",
"description": "External Resource as a ResourceCollection to put",
"in": "body",
"schema": {
"$ref": "#/definitions/ResourceCollection"
}
}
],
"responses": {
"200": {
"description": "Successful Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "getResourceCollection",
"description": "Get External Resource as a ResourceCollection",
"externalDocs": {
"url": "http://tempuri.org"
},
"responses": {
"200": {
"description": "External Resource as a ResourceCollection from get",
"schema": {
"$ref": "#/definitions/ResourceCollection"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
},
"Resource": {
"type": "object",
"x-ms-azure-resource": true,
"description": "Some resource",
"externalDocs": {
"url": "http://tempuri.org"
},
"properties": {
"id": {
"type": "string",
"description": "Resource Id",
"readOnly": true
},
"type": {
"type": "string",
"description": "Resource Type",
"readOnly": true
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"location": {
"type": "string",
"description": "Resource Location"
},
"name": {
"type": "string",
"description": "Resource Name",
"readOnly": true
}
}
},
"FlattenedProduct": {
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"type": "object",
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/FlattenedResourceProperties"
}
}
},
"FlattenedResourceProperties": {
"type": "object",
"properties": {
"pname": {
"type": "string"
},
"lsize": {
"type": "integer",
"format": "int32"
},
"provisioningState": {
"type": "string"
}
}
},
"ResourceCollection": {
"type": "object",
"properties": {
"productresource": {
"type": "object",
"$ref": "#/definitions/FlattenedProduct"
},
"arrayofresources": {
"type": "array",
"items": {
"$ref": "#/definitions/FlattenedProduct"
}
},
"dictionaryofresources": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/FlattenedProduct"
}
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,947 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Azure Special Parameters Test Client",
"description": "Test Infrastructure for AutoRest",
"version": "2015-07-01-preview"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/azurespecials/overwrite/x-ms-client-request-id/method/": {
"get": {
"operationId": "x-ms-client-request-id_Get",
"description": "Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.",
"tags": [
"SubscriptionInCredentials Operations"
],
"responses": {
"200": {
"description": "Successfully received the '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' x-ms-client-request header"
},
"default": {
"description": "Unexpected error"
}
}
}
},
"/azurespecials/overwrite/x-ms-client-request-id/via-param/method/": {
"get": {
"operationId": "x-ms-client-request-id_ParamGet",
"description": "Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0.",
"tags": [
"SubscriptionInCredentials Operations"
],
"parameters": [
{
"name": "x-ms-client-request-id",
"in": "header",
"description": "This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0'",
"type": "string",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully received the '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' x-ms-client-request header"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/method/string/none/path/global/1234-5678-9012-3456/{subscriptionId}": {
"post": {
"operationId": "subscriptionInCredentials_postMethodGlobalValid",
"description": "POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed",
"tags": [
"SubscriptionInCredentials Operations"
],
"parameters": [
{
"$ref": "#/parameters/globalSubscriptionId"
}
],
"responses": {
"200": {
"description": "Successfully received the '1234-5678-9012-3456' credential value from credentials"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/method/string/none/path/global/null/{subscriptionId}": {
"post": {
"operationId": "subscriptionInCredentials_postMethodGlobalNull",
"description": "POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call",
"tags": [
"SubscriptionInCredentials Operations"
],
"parameters": [
{
"$ref": "#/parameters/globalSubscriptionId"
}
],
"responses": {
"200": {
"description": "This should never occur - you should be prevented from calling this method with null subscription Id in credentials"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/method/string/none/path/globalNotProvided/1234-5678-9012-3456/{subscriptionId}": {
"post": {
"operationId": "subscriptionInCredentials_postMethodGlobalNotProvidedValid",
"description": "POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed",
"tags": [
"SubscriptionInCredentials Operations"
],
"parameters": [
{
"$ref": "#/parameters/globalSubscriptionId"
},
{
"$ref": "#/parameters/globalApiVersion"
}
],
"responses": {
"200": {
"description": "Successfully received the '1234-5678-9012-3456' credential value from credentials"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/method/string/none/path/local/1234-5678-9012-3456/{subscriptionId}": {
"post": {
"operationId": "subscriptionInMethod_postMethodLocalValid",
"description": "POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed",
"tags": [
"SubscriptionInMethod Operations"
],
"parameters": [
{
"name": "subscriptionId",
"in": "path",
"description": "This should appear as a method parameter, use value '1234-5678-9012-3456'",
"type": "string",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully received the '1234-5678-9012-3456' credential value from the local parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/method/string/none/path/local/null/{subscriptionId}": {
"post": {
"operationId": "subscriptionInMethod_postMethodLocalNull",
"description": "POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call",
"tags": [
"SubscriptionInMethod Operations"
],
"parameters": [
{
"name": "subscriptionId",
"in": "path",
"description": "This should appear as a method parameter, use value null, client-side validation should prvenet the call",
"type": "string",
"required": true
}
],
"responses": {
"200": {
"description": "You should not reach this response - client side validation should prevent yopu from sending a null subscriptionId"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/path/string/none/path/global/1234-5678-9012-3456/{subscriptionId}": {
"parameters": [
{
"$ref": "#/parameters/globalSubscriptionId"
}
],
"post": {
"operationId": "subscriptionInCredentials_postPathGlobalValid",
"description": "POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed",
"tags": [
"SubscriptionInCredentials Operations"
],
"responses": {
"200": {
"description": "Successfully received the '1234-5678-9012-3456' credential value from credentials"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/path/string/none/path/local/1234-5678-9012-3456/{subscriptionId}": {
"parameters": [
{
"name": "subscriptionId",
"in": "path",
"description": "Should appear as a method parameter -use value '1234-5678-9012-3456'",
"type": "string",
"required": true
}
],
"post": {
"operationId": "subscriptionInMethod_postPathLocalValid",
"description": "POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed",
"tags": [
"SubscriptionInMethod Operations"
],
"responses": {
"200": {
"description": "Successfully received the '1234-5678-9012-3456' credential value from the local parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/swagger/string/none/path/global/1234-5678-9012-3456/{subscriptionId}": {
"post": {
"operationId": "subscriptionInCredentials_postSwaggerGlobalValid",
"description": "POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed",
"tags": [
"SubscriptionInCredentials Operations"
],
"parameters": [
{
"$ref": "#/parameters/globalSubscriptionId"
}
],
"responses": {
"200": {
"description": "Successfully received the '1234-5678-9012-3456' credential value from credentials"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/subscriptionId/swagger/string/none/path/local/1234-5678-9012-3456/{subscriptionId}": {
"post": {
"operationId": "subscriptionInMethod_postSwaggerLocalValid",
"description": "POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed",
"tags": [
"SubscriptionInMethod Operations"
],
"parameters": [
{
"name": "subscriptionId",
"in": "path",
"description": "The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456'",
"type": "string",
"required": true
}
],
"responses": {
"200": {
"description": "Successfully received the '1234-5678-9012-3456' credential value from the local parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/method/string/none/query/global/2015-07-01-preview": {
"get": {
"operationId": "apiVersionDefault_getMethodGlobalValid",
"description": "GET method with api-version modeled in global settings.",
"tags": [
"ApiVersionDefault Operations"
],
"parameters": [
{
"$ref": "#/parameters/globalApiVersion"
}
],
"responses": {
"200": {
"description": "Successfully received the '2015-07-01-preview' api-version value from global client settings"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/method/string/none/query/globalNotProvided/2015-07-01-preview": {
"get": {
"operationId": "apiVersionDefault_getMethodGlobalNotProvidedValid",
"description": "GET method with api-version modeled in global settings.",
"tags": [
"ApiVersionDefault Operations"
],
"parameters": [
{
"$ref": "#/parameters/globalApiVersion"
}
],
"responses": {
"200": {
"description": "Successfully received the '2015-07-01-preview' credential value from global client settings"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/method/string/none/query/local/2.0": {
"get": {
"operationId": "apiVersionLocal_getMethodLocalValid",
"description": "Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed",
"tags": [
"ApiVersionLocal Operations"
],
"parameters": [
{
"name": "api-version",
"in": "query",
"description": "This should appear as a method parameter, use value '2.0'",
"type": "string",
"required": true,
"enum": [ "2.0" ],
"x-ms-api-version": false
}
],
"responses": {
"200": {
"description": "Successfully received the '2.0' api-version value from the local parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/method/string/none/query/local/null": {
"get": {
"operationId": "apiVersionLocal_getMethodLocalNull",
"description": "Get method with api-version modeled in the method. pass in api-version = null to succeed",
"tags": [
"ApiVersionLocal Operations"
],
"parameters": [
{
"name": "api-version",
"in": "query",
"description": "This should appear as a method parameter, use value null, this should result in no serialized parameter",
"type": "string",
"x-ms-api-version": false
}
],
"responses": {
"200": {
"description": "Successfully received no api-version value from the local parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/path/string/none/query/global/2015-07-01-preview": {
"parameters": [
{
"$ref": "#/parameters/globalApiVersion"
}
],
"get": {
"operationId": "apiVersionDefault_getPathGlobalValid",
"description": "GET method with api-version modeled in global settings.",
"tags": [
"ApiVersionDefault Operations"
],
"responses": {
"200": {
"description": "Successfully received the '2015-07-01-preview' api-version value from global client settings"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/path/string/none/query/local/2.0": {
"parameters": [
{
"name": "api-version",
"in": "query",
"description": "This should appear as a method parameter, use value '2.0'",
"type": "string",
"required": true,
"enum": [ "2.0" ],
"x-ms-api-version": false
}
],
"get": {
"operationId": "apiVersionLocal_getPathLocalValid",
"description": "Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed",
"tags": [
"ApiVersionLocal Operations"
],
"responses": {
"200": {
"description": "Successfully received the '2.0' api-version value from the local parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/swagger/string/none/query/global/2015-07-01-preview": {
"get": {
"operationId": "apiVersionDefault_getSwaggerGlobalValid",
"description": "GET method with api-version modeled in global settings.",
"tags": [
"ApiVersionDefault Operations"
],
"parameters": [
{
"$ref": "#/parameters/globalApiVersion"
}
],
"responses": {
"200": {
"description": "Successfully received the '2015-07-01-preview' api-version value from global client settings"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/apiVersion/swagger/string/none/query/local/2.0": {
"get": {
"operationId": "apiVersionLocal_getSwaggerLocalValid",
"description": "Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed",
"tags": [
"ApiVersionLocal Operations"
],
"parameters": [
{
"name": "api-version",
"in": "query",
"description": "The api version, which appears in the query, the value is always '2.0'",
"type": "string",
"required": true,
"enum": [ "2.0" ],
"x-ms-api-version": false
}
],
"responses": {
"200": {
"description": "Successfully received the '2.0' api-version value from the local parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/skipUrlEncoding/method/path/valid/{unencodedPathParam}": {
"get": {
"operationId": "skipUrlEncoding_getMethodPathValid",
"description": "Get method with unencoded path parameter with value 'path1/path2/path3'",
"tags": [
"SkipUrlEncoding Operations"
],
"parameters": [
{
"name": "unencodedPathParam",
"in": "path",
"description": "Unencoded path parameter with value 'path1/path2/path3'",
"type": "string",
"required": true,
"x-ms-skip-url-encoding": true
}
],
"responses": {
"200": {
"description": "Successfully received the path parameter with value 'path1/path2/path3'"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/skipUrlEncoding/path/path/valid/{unencodedPathParam}": {
"parameters": [
{
"name": "unencodedPathParam",
"in": "path",
"description": "Unencoded path parameter with value 'path1/path2/path3'",
"type": "string",
"required": true,
"x-ms-skip-url-encoding": true
}
],
"get": {
"operationId": "skipUrlEncoding_getPathPathValid",
"description": "Get method with unencoded path parameter with value 'path1/path2/path3'",
"tags": [
"SkipUrlEncoding Operations"
],
"responses": {
"200": {
"description": "Successfully received the path parameter with value 'path1/path2/path3'"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/skipUrlEncoding/swagger/path/valid/{unencodedPathParam}": {
"get": {
"operationId": "skipUrlEncoding_getSwaggerPathValid",
"description": "Get method with unencoded path parameter with value 'path1/path2/path3'",
"tags": [
"SkipUrlEncoding Operations"
],
"parameters": [
{
"name": "unencodedPathParam",
"in": "path",
"description": "An unencoded path parameter with value 'path1/path2/path3'",
"type": "string",
"required": true,
"enum": [ "path1/path2/path3" ],
"x-ms-skip-url-encoding": true
}
],
"responses": {
"200": {
"description": "Successfully received the path parameter with value 'path1/path2/path3'"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/skipUrlEncoding/method/query/valid": {
"get": {
"operationId": "skipUrlEncoding_getMethodQueryValid",
"description": "Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'",
"tags": [
"SkipUrlEncoding Operations"
],
"parameters": [
{
"name": "q1",
"in": "query",
"description": "Unencoded query parameter with value 'value1&q2=value2&q3=value3'",
"type": "string",
"required": true,
"x-ms-skip-url-encoding": true
}
],
"responses": {
"200": {
"description": "Successfully received the unencoded query parameter with value 'value1&q2=value2&q3=value3'"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/skipUrlEncoding/method/query/null": {
"get": {
"operationId": "skipUrlEncoding_getMethodQueryNull",
"description": "Get method with unencoded query parameter with value null",
"tags": [
"SkipUrlEncoding Operations"
],
"parameters": [
{
"name": "q1",
"in": "query",
"description": "Unencoded query parameter with value null",
"type": "string",
"x-ms-skip-url-encoding": true
}
],
"responses": {
"200": {
"description": "Successfully received no query parameter"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/skipUrlEncoding/path/query/valid": {
"parameters": [
{
"name": "q1",
"in": "query",
"description": "Unencoded query parameter with value 'value1&q2=value2&q3=value3'",
"type": "string",
"required": true,
"x-ms-skip-url-encoding": true
}
],
"get": {
"operationId": "skipUrlEncoding_getPathQueryValid",
"description": "Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'",
"tags": [
"SkipUrlEncoding Operations"
],
"responses": {
"200": {
"description": "Successfully received the unencoded query parameter with value 'value1&q2=value2&q3=value3'"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/skipUrlEncoding/swagger/query/valid": {
"get": {
"operationId": "skipUrlEncoding_getSwaggerQueryValid",
"description": "Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'",
"tags": [
"SkipUrlEncoding Operations"
],
"parameters": [
{
"name": "q1",
"in": "query",
"description": "An unencoded query parameter with value 'value1&q2=value2&q3=value3'",
"type": "string",
"enum": [ "value1&q2=value2&q3=value3" ],
"required": true,
"x-ms-skip-url-encoding": true
}
],
"responses": {
"200": {
"description": "Successfully received the unencoded query parameter with value 'value1&q2=value2&q3=value3'"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/odata/filter": {
"get": {
"operationId": "odata_getWithFilter",
"description": "Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'",
"tags": [
"odata Operations"
],
"parameters": [
{
"name": "$filter",
"in": "query",
"required": false,
"type": "string",
"description": "The filter parameter with value '$filter=id gt 5 and name eq 'foo''."
},
{
"name": "$top",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"description": "The top parameter with value 10."
},
{
"name": "$orderby",
"in": "query",
"required": false,
"type": "string",
"description": "The orderby parameter with value id."
}
],
"responses": {
"200": {
"description": "Successfully received filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"x-ms-odata": "#/definitions/OdataFilter"
}
},
"/azurespecials/customNamedRequestId": {
"post": {
"operationId": "header_customNamedRequestId",
"description": "Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request",
"parameters": [
{
"name": "foo-client-request-id",
"in": "header",
"required": true,
"type": "string",
"description": "The fooRequestId",
"x-ms-client-request-id": true
}
],
"tags": [
"Header Operations"
],
"x-ms-request-id": "foo-request-id",
"responses": {
"200": {
"headers": {
"foo-request-id": {
"description": "Gets the foo-request-id.",
"type": "string"
}
},
"description": "Gets the foo-request-id"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/customNamedRequestIdParamGrouping": {
"post": {
"operationId": "header_customNamedRequestIdParamGrouping",
"description": "Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group",
"parameters": [
{
"name": "foo-client-request-id",
"in": "header",
"required": true,
"type": "string",
"description": "The fooRequestId",
"x-ms-client-request-id": true,
"x-ms-parameter-grouping": {
}
}
],
"tags": [
"Header Operations"
],
"x-ms-request-id": "foo-request-id",
"responses": {
"200": {
"headers": {
"foo-request-id": {
"description": "Gets the foo-request-id.",
"type": "string"
}
},
"description": "Gets the foo-request-id"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/azurespecials/customNamedRequestIdHead": {
"head": {
"operationId": "header_customNamedRequestIdHead",
"description": "Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request",
"parameters": [
{
"name": "foo-client-request-id",
"in": "header",
"required": true,
"type": "string",
"description": "The fooRequestId",
"x-ms-client-request-id": true
}
],
"tags": [
"Header Operations"
],
"x-ms-request-id": "foo-request-id",
"responses": {
"200": {
"headers": {
"foo-request-id": {
"description": "Gets the foo-request-id.",
"type": "string"
}
},
"description": "Gets the foo-request-id"
},
"404": {
"description": "Gets the foo-request-id"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"parameters": {
"globalSubscriptionId": {
"name": "subscriptionId",
"in": "path",
"description": "The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'",
"type": "string",
"required": true
},
"globalApiVersion": {
"name": "api-version",
"in": "query",
"description": "The api version, which appears in the query, the value is always '2015-07-01-preview'",
"type": "string",
"required": true
}
},
"definitions": {
"Error": {
"type": "object",
"required": ["constantId"],
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"constantId": {
"type": "integer",
"enum": [ 1 ]
},
"message": {
"type": "string"
}
}
},
"OdataFilter": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string"
}
}
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,208 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Bool Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json"],
"consumes": [ "application/json"],
"paths": {
"/bool/true": {
"get": {
"operationId": "bool_getTrue",
"description": "Get true Boolean value",
"x-ms-examples": {
"bool_getTrue": {
"$ref": "./examples/bool_getTrue.json"
}
},
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The true Boolean value",
"schema": {
"type": "boolean",
"enum": [true]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "bool_putTrue",
"description": "Set Boolean value true",
"x-ms-examples": {
"bool_putTrue": {
"$ref": "./examples/bool_putTrue.json"
}
},
"parameters": [
{
"name": "boolBody",
"in": "body",
"schema" : {
"type": "boolean",
"enum": [true]
},
"required": true
}
],
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/bool/false": {
"get": {
"operationId": "bool_getFalse",
"description": "Get false Boolean value",
"x-ms-examples": {
"bool_getFalse": {
"$ref": "./examples/bool_getFalse.json"
}
},
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The false Boolean value",
"schema": {
"type": "boolean",
"enum": [false]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "bool_putFalse",
"description": "Set Boolean value false",
"x-ms-examples": {
"bool_putFalse": {
"$ref": "./examples/bool_putFalse.json"
}
},
"parameters": [
{
"name": "boolBody",
"in": "body",
"schema" : {
"type": "boolean",
"enum": [false]
},
"required": true
}
],
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/bool/null": {
"get": {
"operationId": "bool_getNull",
"description": "Get null Boolean value",
"x-ms-examples": {
"bool_getNull": {
"$ref": "./examples/bool_getNull.json"
}
},
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The null Boolean value",
"schema": {
"type": "boolean",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/bool/invalid": {
"get": {
"operationId": "bool_getInvalid",
"description": "Get invalid Boolean value",
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The invalid Boolean value",
"schema": {
"type": "boolean"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,178 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Bool Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json"],
"consumes": [ "application/json"],
"paths": {
"/bool/true": {
"get": {
"operationId": "bool_getTrue",
"description": "Get true Boolean value",
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The true Boolean value",
"schema": {
"type": "boolean"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "bool_putTrue",
"description": "Set Boolean value true",
"parameters": [
{
"name": "boolBody",
"in": "body",
"schema" : {
"type": "boolean"
},
"required": true
}
],
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/bool/false": {
"get": {
"operationId": "bool_getFalse",
"description": "Get false Boolean value",
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The false Boolean value",
"schema": {
"type": "boolean"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "bool_putFalse",
"description": "Set Boolean value false",
"parameters": [
{
"name": "boolBody",
"in": "body",
"schema" : {
"type": "boolean"
},
"required": true
}
],
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/bool/null": {
"get": {
"operationId": "bool_getNull",
"description": "Get null Boolean value",
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The null Boolean value",
"schema": {
"type": "boolean"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/bool/invalid": {
"get": {
"operationId": "bool_getInvalid",
"description": "Get invalid Boolean value",
"tags": [
"Bool Operations"
],
"responses": {
"200": {
"description": "The invalid Boolean value",
"schema": {
"type": "boolean"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,166 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger BAT Byte Service",
"description": "Test Infrastructure for AutoRest Swagger BAT",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json"],
"consumes": [ "application/json"],
"paths": {
"/byte/null": {
"get": {
"operationId": "byte_getNull",
"description": "Get null byte value",
"x-ms-examples": {
"byte_getNull": {
"$ref": "./examples/byte_getNull.json"
}
},
"tags": [
"Byte Operations"
],
"responses": {
"200": {
"description": "The null byte value",
"schema": {
"description": "The null byte value",
"type": "string",
"format": "byte"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/byte/empty": {
"get": {
"operationId": "byte_getEmpty",
"description": "Get empty byte value ''",
"tags": [
"Byte Operations"
],
"responses": {
"200": {
"description": "The empty byte value ''",
"schema": {
"description": "The empty byte value ''",
"type": "string",
"format": "byte"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/byte/nonAscii": {
"get": {
"operationId": "byte_getNonAscii",
"description": "Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)",
"tags": [
"Byte Operations"
],
"responses": {
"200": {
"description": "Non-ascii base-64 encoded byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)",
"schema": {
"description": "Non-ascii base-64 encoded byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)",
"type": "string",
"format": "byte"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "byte_putNonAscii",
"description": "Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)",
"parameters": [
{
"name": "byteBody",
"in": "body",
"description": "Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)",
"schema" : {
"description": "Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6)",
"type": "string",
"format": "byte"
},
"required": true
}
],
"tags": [
"Byte Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/byte/invalid": {
"get": {
"operationId": "byte_getInvalid",
"description": "Get invalid byte value ':::SWAGGER::::'",
"tags": [
"Byte Operations"
],
"responses": {
"200": {
"description": "The invalid byte value '::::SWAGGER::::'",
"schema": {
"description": "The invalid byte value '::::SWAGGER::::'",
"type": "string",
"format": "byte"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,241 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Date Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/date/null": {
"get": {
"operationId": "date_getNull",
"description": "Get null date value",
"x-ms-examples": {
"date_getNull": {
"$ref": "./examples/date_getNull.json"
}
},
"responses": {
"200": {
"description": "The null date value",
"schema": {
"type": "string",
"format": "date",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/date/invaliddate": {
"get": {
"operationId": "date_getInvalidDate",
"description": "Get invalid date value",
"responses": {
"200": {
"description": "The invalid date value",
"schema": {
"type": "string",
"format": "date"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/date/overflowdate": {
"get": {
"operationId": "date_getOverflowDate",
"description": "Get overflow date value",
"responses": {
"200": {
"description": "The overflow date value",
"schema": {
"type": "string",
"format": "date"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/date/underflowdate": {
"get": {
"operationId": "date_getUnderflowDate",
"description": "Get underflow date value",
"responses": {
"200": {
"description": "The underflow date value",
"schema": {
"type": "string",
"format": "date"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/date/max": {
"put": {
"operationId": "date_putMaxDate",
"description": "Put max date value 9999-12-31",
"x-ms-examples": {
"date_putMaxDate": {
"$ref": "./examples/date_putMaxDate.json"
}
},
"parameters": [
{
"name": "dateBody",
"description": "date body",
"in": "body",
"schema": {
"type": "string",
"format": "date"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max date value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "date_getMaxDate",
"description": "Get max date value 9999-12-31",
"x-ms-examples": {
"date_getMaxDate": {
"$ref": "./examples/date_getMaxDate.json"
}
},
"responses": {
"200": {
"description": "The max date value",
"schema": {
"type": "string",
"format": "date"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/date/min": {
"put": {
"operationId": "date_putMinDate",
"description": "Put min date value 0000-01-01",
"x-ms-examples": {
"date_putMinDate": {
"$ref": "./examples/date_putMinDate.json"
}
},
"parameters": [
{
"name": "dateBody",
"description": "date body",
"in": "body",
"schema": {
"type": "string",
"format": "date"
},
"required": true
}
],
"responses": {
"200": {
"description": "The min date value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "date_getMinDate",
"description": "Get min date value 0000-01-01",
"x-ms-examples": {
"date_getMinDate": {
"$ref": "./examples/date_getMinDate.json"
}
},
"responses": {
"200": {
"description": "The min date value 0000-01-01",
"schema": {
"type": "string",
"format": "date",
"enum": ["0000-01-01"]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,246 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest RFC1123 DateTime Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/datetimerfc1123/null": {
"get": {
"operationId": "datetimerfc1123_getNull",
"description": "Get null datetime value",
"x-ms-examples": {
"datetimerfc1123_getNull": {
"$ref": "./examples/datetimerfc1123_getNull.json"
}
},
"responses": {
"200": {
"description": "The null datetime value",
"schema": {
"type": "string",
"format": "date-time-rfc1123",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetimerfc1123/invalid": {
"get": {
"operationId": "datetimerfc1123_getInvalid",
"description": "Get invalid datetime value",
"responses": {
"200": {
"description": "The invalid datetime value",
"schema": {
"type": "string",
"format": "date-time-rfc1123"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetimerfc1123/overflow": {
"get": {
"operationId": "datetimerfc1123_getOverflow",
"description": "Get overflow datetime value",
"responses": {
"200": {
"description": "The overflow datetime value",
"schema": {
"type": "string",
"format": "date-time-rfc1123"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetimerfc1123/underflow": {
"get": {
"operationId": "datetimerfc1123_getUnderflow",
"description": "Get underflow datetime value",
"responses": {
"200": {
"description": "The underflow datetime value",
"schema": {
"type": "string",
"format": "date-time-rfc1123"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetimerfc1123/max": {
"put": {
"operationId": "datetimerfc1123_putUtcMaxDateTime",
"description": "Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT",
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time-rfc1123"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max datetime value Fri, 31 Dec 9999 23:59:59 GMT"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetimerfc1123/max/lowercase": {
"get": {
"operationId": "datetimerfc1123_getUtcLowercaseMaxDateTime",
"description": "Get max datetime value fri, 31 dec 9999 23:59:59 gmt",
"responses": {
"200": {
"description": "The max datetime value fri, 31 dec 9999 23:59:59 gmt",
"schema": {
"type": "string",
"format": "date-time-rfc1123"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetimerfc1123/max/uppercase": {
"get": {
"operationId": "datetimerfc1123_getUtcUppercaseMaxDateTime",
"description": "Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT",
"responses": {
"200": {
"description": "The max datetime value FRI, 31 DEC 9999 23:59:59 GMT",
"schema": {
"type": "string",
"format": "date-time-rfc1123"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetimerfc1123/min": {
"put": {
"operationId": "datetimerfc1123_putUtcMinDateTime",
"description": "Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT",
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time-rfc1123"
},
"required": true
}
],
"responses": {
"200": {
"description": "The min datetime value Mon, 1 Jan 0001 00:00:00 GMT"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "datetimerfc1123_getUtcMinDateTime",
"description": "Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT",
"responses": {
"200": {
"description": "The min datetime value Mon, 1 Jan 0001 00:00:00 GMT",
"schema": {
"type": "string",
"format": "date-time-rfc1123",
"enum": [
"Sun, 1 Jan 0001 00:00:00 GMT"
]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,618 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest DateTime Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/datetime/null": {
"get": {
"operationId": "datetime_getNull",
"description": "Get null datetime value",
"x-ms-examples": {
"datetime_getNull": {
"$ref": "./examples/datetime_getNull.json"
}
},
"responses": {
"200": {
"description": "The null datetime value",
"schema": {
"type": "string",
"format": "date-time",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/invalid": {
"get": {
"operationId": "datetime_getInvalid",
"description": "Get invalid datetime value",
"responses": {
"200": {
"description": "The invalid datetime value",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/overflow": {
"get": {
"operationId": "datetime_getOverflow",
"description": "Get overflow datetime value",
"responses": {
"200": {
"description": "The overflow datetime value",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/underflow": {
"get": {
"operationId": "datetime_getUnderflow",
"description": "Get underflow datetime value",
"responses": {
"200": {
"description": "The underflow datetime value",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/utc": {
"put": {
"operationId": "datetime_putUtcMaxDateTime",
"description": "Put max datetime value 9999-12-31T23:59:59.999Z",
"x-ms-examples": {
"datetime_putUtcMaxDateTime": {
"$ref": "./examples/datetime_putUtcMaxDateTime.json"
}
},
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max datetime value 9999-12-31T23:59:59.999Z"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/utc7ms": {
"put": {
"operationId": "datetime_putUtcMaxDateTime7Digits",
"description": "This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario",
"summary": "Put max datetime value 9999-12-31T23:59:59.9999999Z",
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max datetime value 9999-12-31T23:59:59.9999999Z"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/utc/lowercase": {
"get": {
"operationId": "datetime_getUtcLowercaseMaxDateTime",
"description": "Get max datetime value 9999-12-31t23:59:59.999z",
"x-ms-examples": {
"datetime_getUtcLowercaseMaxDateTime": {
"$ref": "./examples/datetime_getUtcLowercaseMaxDateTime.json"
}
},
"responses": {
"200": {
"description": "The max datetime value 9999-12-31t23:59:59.999z",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/utc/uppercase": {
"get": {
"operationId": "datetime_getUtcUppercaseMaxDateTime",
"description": "Get max datetime value 9999-12-31T23:59:59.999Z",
"x-ms-examples": {
"datetime_getUtcUppercaseMaxDateTime": {
"$ref": "./examples/datetime_getUtcUppercaseMaxDateTime.json"
}
},
"responses": {
"200": {
"description": "The max datetime value 9999-12-31T23:59:59.999Z",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/utc7ms/uppercase": {
"get": {
"operationId": "datetime_getUtcUppercaseMaxDateTime7Digits",
"description": "This is against the recommendation that asks for 3 digits, but allow to test what happens in that scenario",
"summary": "Get max datetime value 9999-12-31T23:59:59.9999999Z",
"responses": {
"200": {
"description": "The max datetime value 9999-12-31T23:59:59.9999999Z",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/localpositiveoffset": {
"put": {
"operationId": "datetime_putLocalPositiveOffsetMaxDateTime",
"description": "Put max datetime value with positive numoffset 9999-12-31t23:59:59.999+14:00",
"x-ms-examples": {
"datetime_putLocalPositiveOffsetMaxDateTime": {
"$ref": "./examples/datetime_putLocalPositiveOffsetMaxDateTime.json"
}
},
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max datetime value with positive num offset 9999-12-31T23:59:59.999+14:00"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/localpositiveoffset/lowercase": {
"get": {
"operationId": "datetime_getLocalPositiveOffsetLowercaseMaxDateTime",
"description": "Get max datetime value with positive num offset 9999-12-31t23:59:59.999+14:00",
"x-ms-examples": {
"datetime_getLocalPositiveOffsetLowercaseMaxDateTime": {
"$ref": "./examples/datetime_getLocalPositiveOffsetLowercaseMaxDateTime.json"
}
},
"responses": {
"200": {
"description": "The max datetime value 9999-12-31t23:59:59.999+14:00",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/localpositiveoffset/uppercase": {
"get": {
"operationId": "datetime_getLocalPositiveOffsetUppercaseMaxDateTime",
"description": "Get max datetime value with positive num offset 9999-12-31T23:59:59.999+14:00",
"x-ms-examples": {
"datetime_getLocalPositiveOffsetUppercaseMaxDateTime": {
"$ref": "./examples/datetime_getLocalPositiveOffsetUppercaseMaxDateTime.json"
}
},
"responses": {
"200": {
"description": "The max datetime value 9999-12-31T23:59:59.999+14:00",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/localnegativeoffset": {
"put": {
"operationId": "datetime_putLocalNegativeOffsetMaxDateTime",
"description": "Put max datetime value with positive numoffset 9999-12-31t23:59:59.999-14:00",
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max datetime value with positive num offset 9999-12-31T23:59:59.999+14:00"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/localnegativeoffset/uppercase": {
"get": {
"operationId": "datetime_getLocalNegativeOffsetUppercaseMaxDateTime",
"description": "Get max datetime value with positive num offset 9999-12-31T23:59:59.999-14:00",
"responses": {
"200": {
"description": "The max datetime value 9999-12-31T23:59:59.999-14:00",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/max/localnegativeoffset/lowercase": {
"get": {
"operationId": "datetime_getLocalNegativeOffsetLowercaseMaxDateTime",
"description": "Get max datetime value with positive num offset 9999-12-31t23:59:59.999-14:00",
"responses": {
"200": {
"description": "The max datetime value 9999-12-31t23:59:59.999-14:00",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/min/utc": {
"put": {
"operationId": "datetime_putUtcMinDateTime",
"description": "Put min datetime value 0001-01-01T00:00:00Z",
"x-ms-examples": {
"datetime_putUtcMinDateTime": {
"$ref": "./examples/datetime_putUtcMinDateTime.json"
}
},
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true
}
],
"responses": {
"200": {
"description": "The min datetime value 0001-01-01T00:00:00Z"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "datetime_getUtcMinDateTime",
"description": "Get min datetime value 0001-01-01T00:00:00Z",
"x-ms-examples": {
"datetime_getUtcMinDateTime": {
"$ref": "./examples/datetime_getUtcMinDateTime.json"
}
},
"responses": {
"200": {
"description": "The min datetime value 0001-01-01T00:00:00Z",
"schema": {
"type": "string",
"format": "date-time",
"enum": [
"0001-01-01T00:00:00Z"
]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/min/localpositiveoffset": {
"put": {
"operationId": "datetime_putLocalPositiveOffsetMinDateTime",
"description": "Put min datetime value 0001-01-01T00:00:00+14:00",
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true
}
],
"responses": {
"200": {
"description": "The min datetime value 0001-01-01T00:00:00+14:00"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "datetime_getLocalPositiveOffsetMinDateTime",
"description": "Get min datetime value 0001-01-01T00:00:00+14:00",
"responses": {
"200": {
"description": "The min datetime value 0001-01-01T00:00:00+14:00",
"schema": {
"type": "string",
"format": "date-time",
"enum": [
"0001-01-01t00:00:00+14:00"
]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/min/localnegativeoffset": {
"put": {
"operationId": "datetime_putLocalNegativeOffsetMinDateTime",
"description": "Put min datetime value 0001-01-01T00:00:00-14:00",
"x-ms-examples": {
"datetime_putLocalNegativeOffsetMinDateTime": {
"$ref": "./examples/datetime_putLocalNegativeOffsetMinDateTime.json"
}
},
"parameters": [
{
"name": "datetimeBody",
"description": "datetime body",
"in": "body",
"schema": {
"type": "string",
"format": "date-time"
},
"required": true
}
],
"responses": {
"200": {
"description": "The min datetime value 0001-01-01T00:00:00+14:00"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "datetime_getLocalNegativeOffsetMinDateTime",
"description": "Get min datetime value 0001-01-01T00:00:00-14:00",
"x-ms-examples": {
"datetime_getLocalNegativeOffsetMinDateTime": {
"$ref": "./examples/datetime_getLocalNegativeOffsetMinDateTime.json"
}
},
"responses": {
"200": {
"description": "The min datetime value 0001-01-01T00:00:00-14:00",
"schema": {
"type": "string",
"format": "date-time",
"enum": [
"0001-01-01t00:00:00-14:00"
]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/datetime/min/localnooffset": {
"get": {
"operationId": "datetime_getLocalNoOffsetMinDateTime",
"description": "Get min datetime value 0001-01-01T00:00:00",
"x-ms-examples": {
"datetime_getLocalNoOffsetMinDateTime": {
"$ref": "./examples/datetime_getLocalNoOffsetMinDateTime.json"
}
},
"responses": {
"200": {
"description": "The min datetime value 0001-01-01T00:00:00",
"schema": {
"type": "string",
"format": "date-time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,135 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Duration Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/duration/null": {
"get": {
"operationId": "duration_getNull",
"description": "Get null duration value",
"x-ms-examples": {
"duration_getNull": {
"$ref": "./examples/duration_getNull.json"
}
},
"responses": {
"200": {
"description": "The null duration value",
"schema": {
"type": "string",
"format": "duration",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/duration/positiveduration": {
"put": {
"operationId": "duration_putPositiveDuration",
"description": "Put a positive duration value",
"x-ms-examples": {
"duration_putPositiveDuration": {
"$ref": "./examples/duration_putPositiveDuration.json"
}
},
"parameters": [
{
"name": "durationBody",
"description": "duration body",
"in": "body",
"schema": {
"type": "string",
"format": "duration"
},
"required": true
}
],
"responses": {
"200": {
"description": "A positive duration value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "duration_getPositiveDuration",
"description": "Get a positive duration value",
"responses": {
"200": {
"description": "The positive duration value",
"schema": {
"type": "string",
"format": "duration"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/duration/invalid": {
"get": {
"operationId": "duration_getInvalid",
"description": "Get an invalid duration value",
"responses": {
"200": {
"description": "The invalid duration value",
"schema": {
"type": "string",
"format": "duration"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,102 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger BAT File Service",
"description": "Test Infrastructure for AutoRest Swagger BAT",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/files/stream/nonempty": {
"get": {
"operationId": "files_GetFile",
"description": "Get file",
"produces": [ "image/png", "application/json" ],
"tags": [
"Files"
],
"responses": {
"200": {
"description": "The PNG file",
"schema": {
"type": "file"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/files/stream/verylarge": {
"get": {
"operationId": "files_GetFileLarge",
"description": "Get a large file",
"produces": [ "image/png", "application/json" ],
"tags": [
"Files"
],
"responses": {
"200": {
"description": "The large file",
"schema": {
"type": "file"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/files/stream/empty": {
"get": {
"operationId": "files_GetEmptyFile",
"description": "Get empty file",
"produces": [ "image/png", "application/json" ],
"tags": [
"Files"
],
"responses": {
"200": {
"description": "The empty file stream",
"schema": {
"type": "file"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,57 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger BAT Form Data Service",
"description": "Test Infrastructure for AutoRest Swagger BAT",
"version": "1.0.0"
},
"paths": {
"/": {
"get": {
"tags": [
"pet"
],
"summary": "Updates a pet in the store with form data",
"description": "",
"operationId": "updatePetWithForm",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet that needs to be updated",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "formData",
"description": "Updated name of the pet",
"required": false,
"type": "string"
},
{
"name": "status",
"in": "formData",
"description": "Updated status of the pet",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "Pet updated."
},
"405": {
"description": "Invalid input"
}
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,160 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger BAT Form Data Service",
"description": "Test Infrastructure for AutoRest Swagger BAT",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/octet-stream" ],
"consumes": [ "application/json" ],
"paths": {
"/formdata/stream/uploadfile": {
"post": {
"operationId": "formdata_UploadFile",
"consumes": [
"multipart/form-data",
"application/octet-stream"
],
"produces": [
"application/octet-stream",
"application/json"
],
"description": "Upload file",
"tags": [
"Formdata"
],
"parameters": [
{
"name": "fileContent",
"description": "File to upload.",
"required": true,
"type": "file",
"in": "formData"
},
{
"name": "fileName",
"description": "File name to upload. Name has to be spelled exactly as written here.",
"required": true,
"in": "formData",
"type": "string"
}
],
"responses": {
"200": {
"description": "Serialized file stream",
"schema": {
"type": "file"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "formdata_UploadFileViaBody",
"consumes": [
"application/octet-stream"
],
"produces": [
"application/octet-stream",
"application/json"
],
"description": "Upload file",
"tags": [
"Formdata"
],
"parameters": [
{
"name": "fileContent",
"description": "File to upload.",
"required": true,
"in": "body",
"schema": {
"type": "object",
"format": "file"
}
}
],
"responses": {
"200": {
"description": "Serialized file stream",
"schema": {
"type": "file"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/formdata/stream/uploadfiles": {
"post": {
"operationId": "formdata_UploadFiles",
"consumes": [
"multipart/form-data",
"application/octet-stream"
],
"produces": [
"application/octet-stream",
"application/json"
],
"description": "Upload multiple files",
"tags": [
"Formdata"
],
"parameters": [
{
"name": "fileContent",
"description": "Files to upload.",
"required": true,
"type": "array",
"in": "formData",
"items": {
"type": "file"
}
}
],
"responses": {
"200": {
"description": "Serialized file stream",
"schema": {
"type": "file"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,401 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Integer Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/int/null": {
"get": {
"operationId": "int_getNull",
"description": "Get null Int value",
"x-ms-examples": {
"int_getNull": {
"$ref": "./examples/int_getNull.json"
}
},
"responses": {
"200": {
"description": "The null int value",
"schema": {
"type": "integer",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/invalid": {
"get": {
"operationId": "int_getInvalid",
"description": "Get invalid Int value",
"responses": {
"200": {
"description": "The invalid int value",
"schema": {
"type": "integer"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/overflowint32": {
"get": {
"operationId": "int_getOverflowInt32",
"description": "Get overflow Int32 value",
"responses": {
"200": {
"description": "The overflow Int32 value",
"schema": {
"type": "integer",
"format": "int32"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/underflowint32": {
"get": {
"operationId": "int_getUnderflowInt32",
"description": "Get underflow Int32 value",
"responses": {
"200": {
"description": "The underflow Int32 value",
"schema": {
"type": "integer",
"format": "int32"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/overflowint64": {
"get": {
"operationId": "int_getOverflowInt64",
"description": "Get overflow Int64 value",
"responses": {
"200": {
"description": "The overflow Int64 value",
"schema": {
"type": "integer",
"format": "int64"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/underflowint64": {
"get": {
"operationId": "int_getUnderflowInt64",
"description": "Get underflow Int64 value",
"responses": {
"200": {
"description": "The underflow Int64 value",
"schema": {
"type": "integer",
"format": "int64"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/max/32": {
"put": {
"operationId": "int_putMax32",
"description": "Put max int32 value",
"x-ms-examples": {
"int_putMax32": {
"$ref": "./examples/int_putMax32.json"
}
},
"parameters": [
{
"name": "intBody",
"description": "int body",
"in": "body",
"schema": {
"type": "integer",
"format": "int32"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max int32 value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/max/64": {
"put": {
"operationId": "int_putMax64",
"description": "Put max int64 value",
"x-ms-examples": {
"int_putMax64": {
"$ref": "./examples/int_putMax64.json"
}
},
"parameters": [
{
"name": "intBody",
"description": "int body",
"in": "body",
"schema": {
"type": "integer",
"format": "int64"
},
"required": true
}
],
"responses": {
"200": {
"description": "The max int64 value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/min/32": {
"put": {
"operationId": "int_putMin32",
"description": "Put min int32 value",
"x-ms-examples": {
"int_putMin32": {
"$ref": "./examples/int_putMin32.json"
}
},
"parameters": [
{
"name": "intBody",
"description": "int body",
"in": "body",
"schema": {
"type": "integer",
"format": "int32"
},
"required": true
}
],
"responses": {
"200": {
"description": "The min int32 value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/min/64": {
"put": {
"operationId": "int_putMin64",
"description": "Put min int64 value",
"x-ms-examples": {
"int_putMin64": {
"$ref": "./examples/int_putMin64.json"
}
},
"parameters": [
{
"name": "intBody",
"description": "int body",
"in": "body",
"schema": {
"type": "integer",
"format": "int64"
},
"required": true
}
],
"responses": {
"200": {
"description": "The min int64 value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/unixtime": {
"get": {
"operationId": "int_getUnixTime",
"description": "Get datetime encoded as Unix time value",
"x-ms-examples": {
"int_getUnixTime": {
"$ref": "./examples/int_getUnixTime.json"
}
},
"responses": {
"200": {
"description": "The date value encoded as Unix time",
"schema": {
"type": "integer",
"format": "unixtime"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "int_putUnixTimeDate",
"description": "Put datetime encoded as Unix time",
"parameters": [
{
"name": "intBody",
"description": "int body",
"in": "body",
"schema": {
"type": "integer",
"format": "unixtime"
},
"required": true
}
],
"responses": {
"200": {
"description": "The datetime value encoded as Unix time"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/invalidunixtime": {
"get": {
"operationId": "int_getInvalidUnixTime",
"description": "Get invalid Unix time value",
"responses": {
"200": {
"description": "The invalid Unix time value",
"schema": {
"type": "integer",
"format": "unixtime"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/int/nullunixtime": {
"get": {
"operationId": "int_getNullUnixTime",
"description": "Get null Unix time value",
"x-ms-examples": {
"int_getNullUnixTime": {
"$ref": "./examples/int_getNullUnixTime.json"
}
},
"responses": {
"200": {
"description": "The null Unix time value",
"schema": {
"type": "integer",
"format": "unixtime",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,713 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Number Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/number/null": {
"get": {
"operationId": "number_getNull",
"description": "Get null Number value",
"x-ms-examples": {
"number_getNull": {
"$ref": "./examples/number_getNull.json"
}
},
"responses": {
"200": {
"description": "The null number value",
"schema": {
"type": "number",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/invalidfloat": {
"get": {
"operationId": "number_getInvalidFloat",
"description": "Get invalid float Number value",
"responses": {
"200": {
"description": "The invalid float number value",
"schema": {
"type": "number",
"format": "float"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/invaliddouble": {
"get": {
"operationId": "number_getInvalidDouble",
"description": "Get invalid double Number value",
"responses": {
"200": {
"description": "The invalid double number value",
"schema": {
"type": "number",
"format": "double"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/invaliddecimal": {
"get": {
"operationId": "number_getInvalidDecimal",
"description": "Get invalid decimal Number value",
"responses": {
"200": {
"description": "The invalid decimal number value",
"schema": {
"type": "number",
"format": "decimal"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/float/3.402823e+20": {
"put": {
"operationId": "number_putBigFloat",
"description": "Put big float value 3.402823e+20",
"x-ms-examples": {
"number_putBigFloat": {
"$ref": "./examples/number_putBigFloat.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "float"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big float value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigFloat",
"description": "Get big float value 3.402823e+20",
"x-ms-examples": {
"number_getBigFloat": {
"$ref": "./examples/number_getBigFloat.json"
}
},
"responses": {
"200": {
"description": "The big float value",
"schema": {
"type": "number",
"format": "float",
"enum": [3.402823e+20]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/double/2.5976931e+101": {
"put": {
"operationId": "number_putBigDouble",
"description": "Put big double value 2.5976931e+101",
"x-ms-examples": {
"number_putBigDouble": {
"$ref": "./examples/number_putBigDouble.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "double"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDouble",
"description": "Get big double value 2.5976931e+101",
"x-ms-examples": {
"number_getBigDouble": {
"$ref": "./examples/number_getBigDouble.json"
}
},
"responses": {
"200": {
"description": "The big double value 2.5976931e+101",
"schema": {
"type": "number",
"format": "double",
"enum": [2.5976931e+101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/double/99999999.99": {
"put": {
"operationId": "number_putBigDoublePositiveDecimal",
"description": "Put big double value 99999999.99",
"x-ms-examples": {
"number_putBigDoublePositiveDecimal": {
"$ref": "./examples/number_putBigDoublePositiveDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"in": "body",
"schema": {
"type": "number",
"format": "double",
"enum": [99999999.99]
},
"required": true
}
],
"responses": {
"200": {
"description": "The big double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDoublePositiveDecimal",
"description": "Get big double value 99999999.99",
"x-ms-examples": {
"number_getBigDoublePositiveDecimal": {
"$ref": "./examples/number_getBigDoublePositiveDecimal.json"
}
},
"responses": {
"200": {
"description": "The big double value 99999999.99",
"schema": {
"type": "number",
"format": "double",
"enum": [99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/double/-99999999.99": {
"put": {
"operationId": "number_putBigDoubleNegativeDecimal",
"description": "Put big double value -99999999.99",
"x-ms-examples": {
"number_putBigDoubleNegativeDecimal": {
"$ref": "./examples/number_putBigDoubleNegativeDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"in": "body",
"schema": {
"type": "number",
"format": "double",
"enum": [-99999999.99]
},
"required": true
}
],
"responses": {
"200": {
"description": "The big double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDoubleNegativeDecimal",
"description": "Get big double value -99999999.99",
"x-ms-examples": {
"number_getBigDoubleNegativeDecimal": {
"$ref": "./examples/number_getBigDoubleNegativeDecimal.json"
}
},
"responses": {
"200": {
"description": "The big double value -99999999.99",
"schema": {
"type": "number",
"format": "double",
"enum": [-99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/decimal/2.5976931e+101": {
"put": {
"operationId": "number_putBigDecimal",
"description": "Put big decimal value 2.5976931e+101",
"x-ms-examples": {
"number_putBigDecimal": {
"$ref": "./examples/number_putBigDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "decimal"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDecimal",
"description": "Get big decimal value 2.5976931e+101",
"x-ms-examples": {
"number_getBigDecimal": {
"$ref": "./examples/number_getBigDecimal.json"
}
},
"responses": {
"200": {
"description": "The big decimal value 2.5976931e+101",
"schema": {
"type": "number",
"format": "decimal",
"enum": [2.5976931e+101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/decimal/99999999.99": {
"put": {
"operationId": "number_putBigDecimalPositiveDecimal",
"description": "Put big decimal value 99999999.99",
"x-ms-examples": {
"number_putBigDecimalPositiveDecimal": {
"$ref": "./examples/number_putBigDecimalPositiveDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"in": "body",
"schema": {
"type": "number",
"format": "decimal",
"enum": [99999999.99]
},
"required": true
}
],
"responses": {
"200": {
"description": "The big decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDecimalPositiveDecimal",
"description": "Get big decimal value 99999999.99",
"x-ms-examples": {
"number_getBigDecimalPositiveDecimal": {
"$ref": "./examples/number_getBigDecimalPositiveDecimal.json"
}
},
"responses": {
"200": {
"description": "The big decimal value 99999999.99",
"schema": {
"type": "number",
"format": "decimal",
"enum": [99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/decimal/-99999999.99": {
"put": {
"operationId": "number_putBigDecimalNegativeDecimal",
"description": "Put big decimal value -99999999.99",
"x-ms-examples": {
"number_putBigDecimalNegativeDecimal": {
"$ref": "./examples/number_putBigDecimalNegativeDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"in": "body",
"schema": {
"type": "number",
"format": "decimal",
"enum": [-99999999.99]
},
"required": true
}
],
"responses": {
"200": {
"description": "The big decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDecimalNegativeDecimal",
"description": "Get big decimal value -99999999.99",
"x-ms-examples": {
"number_getBigDecimalNegativeDecimal": {
"$ref": "./examples/number_getBigDecimalNegativeDecimal.json"
}
},
"responses": {
"200": {
"description": "The big decimal value -99999999.99",
"schema": {
"type": "number",
"format": "decimal",
"enum": [-99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/small/float/3.402823e-20": {
"put": {
"operationId": "number_putSmallFloat",
"description": "Put small float value 3.402823e-20",
"x-ms-examples": {
"number_putSmallFloat": {
"$ref": "./examples/number_putSmallFloat.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "float"
},
"required": true
}
],
"responses": {
"200": {
"description": "The small float value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getSmallFloat",
"description": "Get big double value 3.402823e-20",
"x-ms-examples": {
"number_getSmallFloat": {
"$ref": "./examples/number_getSmallFloat.json"
}
},
"responses": {
"200": {
"description": "The big double value 3.402823e-20",
"schema": {
"type": "number",
"format": "double",
"enum": [3.402823e-20]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/small/double/2.5976931e-101": {
"put": {
"operationId": "number_putSmallDouble",
"description": "Put small double value 2.5976931e-101",
"x-ms-examples": {
"number_putSmallDouble": {
"$ref": "./examples/number_putSmallDouble.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "double"
},
"required": true
}
],
"responses": {
"200": {
"description": "The small double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getSmallDouble",
"description": "Get big double value 2.5976931e-101",
"x-ms-examples": {
"number_getSmallDouble": {
"$ref": "./examples/number_getSmallDouble.json"
}
},
"responses": {
"200": {
"description": "The big double value 2.5976931e-101",
"schema": {
"type": "number",
"format": "double",
"enum": [2.5976931e-101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/small/decimal/2.5976931e-101": {
"put": {
"operationId": "number_putSmallDecimal",
"description": "Put small decimal value 2.5976931e-101",
"x-ms-examples": {
"number_putSmallDecimal": {
"$ref": "./examples/number_putSmallDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "decimal"
},
"required": true
}
],
"responses": {
"200": {
"description": "The small decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getSmallDecimal",
"description": "Get small decimal value 2.5976931e-101",
"x-ms-examples": {
"number_getSmallDecimal": {
"$ref": "./examples/number_getSmallDecimal.json"
}
},
"responses": {
"200": {
"description": "The small decimal value 2.5976931e-101",
"schema": {
"type": "number",
"format": "decimal",
"enum": [2.5976931e-101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,691 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Number Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/number/null": {
"get": {
"operationId": "number_getNull",
"description": "Get null Number value",
"x-ms-examples": {
"number_getNull": {
"$ref": "./examples/number_getNull.json"
}
},
"responses": {
"200": {
"description": "The null number value",
"schema": {
"type": "number"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/invalidfloat": {
"get": {
"operationId": "number_getInvalidFloat",
"description": "Get invalid float Number value",
"responses": {
"200": {
"description": "The invalid float number value",
"schema": {
"type": "number",
"format": "float"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/invaliddouble": {
"get": {
"operationId": "number_getInvalidDouble",
"description": "Get invalid double Number value",
"responses": {
"200": {
"description": "The invalid double number value",
"schema": {
"type": "number",
"format": "double"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/float/3.402823e+20": {
"put": {
"operationId": "number_putBigFloat",
"description": "Put big float value 3.402823e+20",
"x-ms-examples": {
"number_putBigFloat": {
"$ref": "./examples/number_putBigFloat.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "float"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big float value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigFloat",
"description": "Get big float value 3.402823e+20",
"x-ms-examples": {
"number_getBigFloat": {
"$ref": "./examples/number_getBigFloat.json"
}
},
"responses": {
"200": {
"description": "The big float value",
"schema": {
"type": "number",
"format": "float",
"enum": [3.402823e+20]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/double/2.5976931e+101": {
"put": {
"operationId": "number_putBigDouble",
"description": "Put big double value 2.5976931e+101",
"x-ms-examples": {
"number_putBigDouble": {
"$ref": "./examples/number_putBigDouble.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "double"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDouble",
"description": "Get big double value 2.5976931e+101",
"x-ms-examples": {
"number_getBigDouble": {
"$ref": "./examples/number_getBigDouble.json"
}
},
"responses": {
"200": {
"description": "The big double value 2.5976931e+101",
"schema": {
"type": "number",
"format": "double",
"enum": [2.5976931e+101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/double/99999999.99": {
"put": {
"operationId": "number_putBigDoublePositiveDecimal",
"description": "Put big double value 99999999.99",
"x-ms-examples": {
"number_putBigDoublePositiveDecimal": {
"$ref": "./examples/number_putBigDoublePositiveDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "double"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDoublePositiveDecimal",
"description": "Get big double value 99999999.99",
"x-ms-examples": {
"number_getBigDoublePositiveDecimal": {
"$ref": "./examples/number_getBigDoublePositiveDecimal.json"
}
},
"responses": {
"200": {
"description": "The big double value 99999999.99",
"schema": {
"type": "number",
"format": "double",
"enum": [99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/double/-99999999.99": {
"put": {
"operationId": "number_putBigDoubleNegativeDecimal",
"description": "Put big double value -99999999.99",
"x-ms-examples": {
"number_putBigDoubleNegativeDecimal": {
"$ref": "./examples/number_putBigDoubleNegativeDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "double"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDoubleNegativeDecimal",
"description": "Get big double value -99999999.99",
"x-ms-examples": {
"number_getBigDoubleNegativeDecimal": {
"$ref": "./examples/number_getBigDoubleNegativeDecimal.json"
}
},
"responses": {
"200": {
"description": "The big double value -99999999.99",
"schema": {
"type": "number",
"format": "double",
"enum": [-99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/decimal/2.5976931e+101": {
"put": {
"operationId": "number_putBigDecimal",
"description": "Put big decimal value 2.5976931e+101",
"x-ms-examples": {
"number_putBigDecimal": {
"$ref": "./examples/number_putBigDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "decimal"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDecimal",
"description": "Get big decimal value 2.5976931e+101",
"x-ms-examples": {
"number_getBigDecimal": {
"$ref": "./examples/number_getBigDecimal.json"
}
},
"responses": {
"200": {
"description": "The big decimal value 2.5976931e+101",
"schema": {
"type": "number",
"format": "decimal",
"enum": [2.5976931e+101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/decimal/99999999.99": {
"put": {
"operationId": "number_putBigDecimalPositiveDecimal",
"description": "Put big decimal value 99999999.99",
"x-ms-examples": {
"number_putBigDecimalPositiveDecimal": {
"$ref": "./examples/number_putBigDecimalPositiveDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "decimal"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDecimalPositiveDecimal",
"description": "Get big decimal value 99999999.99",
"x-ms-examples": {
"number_getBigDecimalPositiveDecimal": {
"$ref": "./examples/number_getBigDecimalPositiveDecimal.json"
}
},
"responses": {
"200": {
"description": "The big decimal value 99999999.99",
"schema": {
"type": "number",
"format": "decimal",
"enum": [99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/big/decimal/-99999999.99": {
"put": {
"operationId": "number_putBigDecimalNegativeDecimal",
"description": "Put big decimal value -99999999.99",
"x-ms-examples": {
"number_putBigDecimalNegativeDecimal": {
"$ref": "./examples/number_putBigDecimalNegativeDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "decimal"
},
"required": true
}
],
"responses": {
"200": {
"description": "The big decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getBigDecimalNegativeDecimal",
"description": "Get big decimal value -99999999.99",
"x-ms-examples": {
"number_getBigDecimalNegativeDecimal": {
"$ref": "./examples/number_getBigDecimalNegativeDecimal.json"
}
},
"responses": {
"200": {
"description": "The big decimal value -99999999.99",
"schema": {
"type": "number",
"format": "decimal",
"enum": [-99999999.99]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/small/float/3.402823e-20": {
"put": {
"operationId": "number_putSmallFloat",
"description": "Put small float value 3.402823e-20",
"x-ms-examples": {
"number_putSmallFloat": {
"$ref": "./examples/number_putSmallFloat.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "float"
},
"required": true
}
],
"responses": {
"200": {
"description": "The small float value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getSmallFloat",
"description": "Get big double value 3.402823e-20",
"x-ms-examples": {
"number_getSmallFloat": {
"$ref": "./examples/number_getSmallFloat.json"
}
},
"responses": {
"200": {
"description": "The big double value 3.402823e-20",
"schema": {
"type": "number",
"format": "double",
"enum": [3.402823e-20]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/small/double/2.5976931e-101": {
"put": {
"operationId": "number_putSmallDouble",
"description": "Put small double value 2.5976931e-101",
"x-ms-examples": {
"number_putSmallDouble": {
"$ref": "./examples/number_putSmallDouble.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "double"
},
"required": true
}
],
"responses": {
"200": {
"description": "The small double value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getSmallDouble",
"description": "Get big double value 2.5976931e-101",
"x-ms-examples": {
"number_getSmallDouble": {
"$ref": "./examples/number_getSmallDouble.json"
}
},
"responses": {
"200": {
"description": "The big double value 2.5976931e-101",
"schema": {
"type": "number",
"format": "double",
"enum": [2.5976931e-101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/number/small/decimal/2.5976931e-101": {
"put": {
"operationId": "number_putSmallDecimal",
"description": "Put small decimal value 2.5976931e-101",
"x-ms-examples": {
"number_putSmallDecimal": {
"$ref": "./examples/number_putSmallDecimal.json"
}
},
"parameters": [
{
"name": "numberBody",
"description": "number body",
"in": "body",
"schema": {
"type": "number",
"format": "decimal"
},
"required": true
}
],
"responses": {
"200": {
"description": "The small decimal value"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"get": {
"operationId": "number_getSmallDecimal",
"description": "Get small decimal value 2.5976931e-101",
"x-ms-examples": {
"number_getSmallDecimal": {
"$ref": "./examples/number_getSmallDecimal.json"
}
},
"responses": {
"200": {
"description": "The small decimal value 2.5976931e-101",
"schema": {
"type": "number",
"format": "decimal",
"enum": [2.5976931e-101]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,628 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger BAT Service",
"description": "Test Infrastructure for AutoRest Swagger BAT",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/string/null": {
"get": {
"operationId": "string_getNull",
"description": "Get null string value value",
"x-ms-examples": {
"string_getNull": {
"$ref": "./examples/string_getNull.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The null String value",
"schema": {
"type": "string",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putNull",
"description": "Set string value null",
"x-ms-examples": {
"string_putNull": {
"$ref": "./examples/string_putNull.json"
}
},
"parameters": [
{
"name": "stringBody",
"description": "string body",
"in": "body",
"schema": {
"type": "string",
"x-nullable": true
}
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/empty": {
"get": {
"operationId": "string_getEmpty",
"description": "Get empty string value value ''",
"x-ms-examples": {
"string_getEmpty": {
"$ref": "./examples/string_getEmpty.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The empty String value",
"schema": {
"type": "string",
"enum": [""]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putEmpty",
"description": "Set string value empty ''",
"x-ms-examples": {
"string_putEmpty": {
"$ref": "./examples/string_putEmpty.json"
}
},
"parameters": [
{
"name": "stringBody",
"description": "string body",
"in": "body",
"schema": {
"type": "string",
"enum": [""]
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/mbcs": {
"get": {
"operationId": "string_getMbcs",
"description": "Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'",
"x-ms-examples": {
"string_getMbcs": {
"$ref": "./examples/string_getMbcs.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The mbcs String value",
"schema": {
"type": "string",
"enum": [ "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€" ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putMbcs",
"description": "Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'",
"x-ms-examples": {
"string_putMbcs": {
"$ref": "./examples/string_putMbcs.json"
}
},
"parameters": [
{
"name": "stringBody",
"description": "string body",
"in": "body",
"schema": {
"type": "string",
"enum": [ "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€" ]
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/whitespace": {
"get": {
"operationId": "string_getWhitespace",
"description": "Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"x-ms-examples": {
"string_getWhitespace": {
"$ref": "./examples/string_getWhitespace.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"schema": {
"type": "string",
"enum": [ " Now is the time for all good men to come to the aid of their country " ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putWhitespace",
"description": "Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"x-ms-examples": {
"string_putWhitespace": {
"$ref": "./examples/string_putWhitespace.json"
}
},
"parameters": [
{
"name": "stringBody",
"description": "string body",
"in": "body",
"schema": {
"type": "string",
"enum": [ " Now is the time for all good men to come to the aid of their country " ]
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/notExpandable": {
"get": {
"operationId": "enum_getNotExpandable",
"description": "Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'.",
"x-ms-examples": {
"enum_getNotExpandable": {
"$ref": "./examples/enum_getNotExpandable.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"schema": {
"x-ms-enum": { "name": "Colors", "modelAsString": false},
"type": "string",
"enum": [ "red color", "green-color", "blue_color" ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putNotExpandable",
"description": "Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"x-ms-examples": {
"enum_putNotExpandable": {
"$ref": "./examples/enum_putNotExpandable.json"
}
},
"parameters": [
{
"name": "stringBody",
"description": "string body",
"in": "body",
"schema": {
"x-ms-enum": { "name": "Colors", "modelAsString": false},
"type": "string",
"enum": [ "red color", "green-color", "blue_color" ]
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/Referenced": {
"get": {
"operationId": "enum_getReferenced",
"description": "Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'.",
"x-ms-examples": {
"enum_getReferenced": {
"$ref": "./examples/enum_getReferenced.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"schema": {
"$ref": "#/definitions/RefColors"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putReferenced",
"description": "Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"x-ms-examples": {
"enum_putReferenced": {
"$ref": "./examples/enum_putReferenced.json"
}
},
"parameters": [
{
"name": "enumStringBody",
"description": "enum string body",
"in": "body",
"schema": {
"$ref": "#/definitions/RefColors"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/ReferencedConstant": {
"get": {
"operationId": "enum_getReferencedConstant",
"description": "Get value 'green-color' from the constant.",
"x-ms-examples": {
"enum_getReferencedConstant": {
"$ref": "./examples/enum_getReferencedConstant.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value 'green-color' from a constant",
"schema": {
"$ref": "#/definitions/RefColorConstant"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putReferencedConstant",
"description": "Sends value 'green-color' from a constant",
"x-ms-examples": {
"enum_putReferencedConstant": {
"$ref": "./examples/enum_putReferencedConstant.json"
}
},
"parameters": [
{
"name": "enumStringBody",
"description": "enum string body",
"in": "body",
"schema": {
"$ref": "#/definitions/RefColorConstant"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/notProvided": {
"get": {
"operationId": "string_getNotProvided",
"description": "Get String value when no string value is sent in response payload",
"x-ms-examples": {
"string_getNotProvided": {
"$ref": "./examples/string_getNotProvided.json"
}
},
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The not provided string value",
"schema": {
"type": "string"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/base64Encoding": {
"get": {
"operationId": "string_getBase64Encoded",
"description": "Get value that is base64 encoded",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The base64 encoded string value",
"schema": {
"type": "string",
"format": "byte"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/base64UrlEncoding": {
"get": {
"operationId": "string_getBase64UrlEncoded",
"description": "Get value that is base64url encoded",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The base64url encoded string value",
"schema": {
"type": "string",
"format": "base64url"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putBase64UrlEncoded",
"description": "Put value that is base64url encoded",
"parameters": [
{
"name": "stringBody",
"description": "string body",
"in": "body",
"schema": {
"type": "string",
"format": "base64url"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/nullBase64UrlEncoding": {
"get": {
"operationId": "string_getNullBase64UrlEncoded",
"description": "Get null value that is expected to be base64url encoded",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The null value",
"schema": {
"type": "string",
"format": "base64url",
"x-nullable": true
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
},
"RefColors": {
"x-ms-enum": { "name": "Colors", "modelAsString": false},
"type": "string",
"enum": [ "red color", "green-color", "blue_color" ],
"description": "Referenced Color Enum Description."
},
"RefColorConstant": {
"type": "object",
"properties": {
"ColorConstant": {
"x-ms-enum": { "name": "ColorConstant", "modelAsString": false},
"type": "string",
"enum": [ "green-color" ],
"description": "Referenced Color Constant Description."
},
"field1": {
"type": "string",
"description": "Sample string."
}
},
"required": [ "ColorConstant" ]
}
}
}

Просмотреть файл

@ -0,0 +1,540 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger BAT Service",
"description": "Test Infrastructure for AutoRest Swagger BAT",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/string/null": {
"get": {
"operationId": "string_getNull",
"description": "Get null string value value",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The null String value",
"schema": {
"type": "string",
"enum": [ null ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putNull",
"description": "Set string value null",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
}
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/empty": {
"get": {
"operationId": "string_getEmpty",
"description": "Get empty string value value ''",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The empty String value",
"schema": {
"type": "string",
"enum": [ "" ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putEmpty",
"description": "Set string value empty ''",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/mbcs": {
"get": {
"operationId": "string_getMbcs",
"description": "Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The mbcs String value",
"schema": {
"type": "string",
"enum": [ "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€" ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putMbcs",
"description": "Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€'",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/whitespace": {
"get": {
"operationId": "string_getWhitespace",
"description": "Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"schema": {
"type": "string",
"enum": [ " Now is the time for all good men to come to the aid of their country " ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putWhitespace",
"description": "Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/notExpandable": {
"get": {
"operationId": "enum_getNotExpandable",
"description": "Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'.",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"schema": {
"x-ms-enum": { "name": "Colors", "modelAsString": false},
"type": "string",
"enum": [ "red color", "green-color", "blue_color" ]
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putNotExpandable",
"description": "Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"x-ms-enum": { "name": "Colors", "modelAsString": false},
"type": "string",
"enum": [ "red color", "green-color", "blue_color" ]
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/Referenced": {
"get": {
"operationId": "enum_getReferenced",
"description": "Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'.",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"schema": {
"$ref": "#/definitions/RefColors"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putReferenced",
"description": "Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'",
"parameters": [
{
"name": "enumStringBody",
"in": "body",
"schema": {
"$ref": "#/definitions/RefColors"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/enum/ReferencedConstant": {
"get": {
"operationId": "enum_getReferencedConstant",
"description": "Get value 'green-color' from the constant.",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The String value 'green-color' from a constant",
"schema": {
"$ref": "#/definitions/RefColorConstant"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "enum_putReferencedConstant",
"description": "Sends value 'green-color' from a constant",
"parameters": [
{
"name": "enumStringBody",
"in": "body",
"schema": {
"$ref": "#/definitions/RefColorConstant"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/notProvided": {
"get": {
"operationId": "string_getNotProvided",
"description": "Get String value when no string value is sent in response payload",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The not provided string value",
"schema": {
"type": "string"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/base64Encoding": {
"get": {
"operationId": "string_getBase64Encoded",
"description": "Get value that is base64 encoded",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The base64 encoded string value",
"schema": {
"type": "string",
"format": "base64url"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/base64UrlEncoding": {
"get": {
"operationId": "string_getBase64UrlEncoded",
"description": "Get value that is base64url encoded",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The base64url encoded string value",
"schema": {
"type": "string",
"format": "base64url"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "string_putBase64UrlEncoded",
"description": "Put value that is base64url encoded",
"parameters": [
{
"name": "stringBody",
"in": "body",
"schema": {
"type": "string",
"format": "base64url"
},
"required": true
}
],
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "Empty Response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/string/nullBase64UrlEncoding": {
"get": {
"operationId": "string_getNullBase64UrlEncoded",
"description": "Get null value that is expected to be base64url encoded",
"tags": [
"String Operations"
],
"responses": {
"200": {
"description": "The null value",
"schema": {
"type": "string",
"format": "base64url"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
},
"RefColors": {
"x-ms-enum": { "name": "Colors", "modelAsString": false},
"type": "string",
"enum": [ "red color", "green-color", "blue_color" ],
"description": "Referenced Color Enum Description."
},
"RefColorConstant": {
"type": "object",
"properties": {
"ColorConstant": {
"x-ms-enum": { "name": "ColorConstant", "modelAsString": false},
"type": "string",
"enum": [ "green-color" ],
"description": "Referenced Color Constant Description."
},
"field1": {
"type": "string",
"description": "Sample string."
}
},
"required": [ "ColorConstant" ]
}
}
}

Просмотреть файл

@ -0,0 +1,97 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Time Test Service",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/time/get": {
"get": {
"operationId": "time_get",
"description": "Get time value \"11:34:56\"",
"x-ms-examples": {
"time_get": {
"$ref": "./examples/time_get.json"
}
},
"responses": {
"200": {
"description": "The time value",
"schema": {
"type": "string",
"format": "time"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/time/put": {
"put": {
"operationId": "time_put",
"description": "Put time value \"08:07:56\"",
"x-ms-examples": {
"time_put": {
"$ref": "./examples/time_put.json"
}
},
"parameters": [
{
"name": "timeBody",
"in": "body",
"description": "Put time value \"08:07:56\" in parameter to pass testserver",
"schema": {
"type": "string",
"format": "time"
},
"required": true
}
],
"responses": {
"200": {
"description": "Received correct time",
"schema": {
"type": "string"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,272 @@
{
"swagger": "2.0",
"info": {
"title": "Complex Model Client",
"description": "Some cool documentation.",
"version": "2014-04-01-preview"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/Microsoft.Cache/Redis": {
"get": {
"operationId": "list",
"summary": "Product Types",
"description": "The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.",
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParamterer"
},
{
"name": "resourceGroupName",
"in": "path",
"description": "Resource Group ID.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"tags": [
"Redis"
],
"responses": {
"200": {
"description": "A list of caches",
"schema": {
"$ref": "#/definitions/CatalogArray"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"post": {
"operationId": "create",
"summary": "Create products",
"description": "Resets products.",
"parameters": [
{
"name": "subscriptionId",
"in": "path",
"description": "Subscription ID.",
"required": true,
"type": "string"
},
{
"name": "resourceGroupName",
"in": "path",
"description": "Resource Group ID.",
"required": true,
"type": "string"
},
{
"name": "bodyParameter",
"in": "body",
"description": "body Parameter",
"required": true,
"schema": {
"$ref": "#/definitions/CatalogDictionaryOfArray"
}
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"tags": [
"Redis"
],
"responses": {
"200": {
"description": "A list of caches",
"schema": {
"$ref": "#/definitions/CatalogDictionary"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
},
"put": {
"operationId": "update",
"summary": "Update products",
"description": "Resets products.",
"parameters": [
{
"name": "subscriptionId",
"in": "path",
"description": "Subscription ID.",
"required": true,
"type": "string"
},
{
"name": "resourceGroupName",
"in": "path",
"description": "Resource Group ID.",
"required": true,
"type": "string"
},
{
"name": "bodyParameter",
"in": "body",
"description": "body Parameter",
"required": true,
"schema": {
"$ref": "#/definitions/CatalogArrayOfDictionary"
}
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"tags": [
"Redis"
],
"responses": {
"200": {
"description": "A list of caches",
"schema": {
"$ref": "#/definitions/CatalogArray"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"Product": {
"type": "object",
"description": "The product documentation.",
"properties": {
"product_id": {
"type": "string",
"description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles."
},
"description": {
"type": "string",
"description": "Description of product."
},
"display_name": {
"type": "string",
"description": "Display name of product."
},
"capacity": {
"type": "string",
"description": "Capacity of product. For example, 4 people.",
"default": "100"
},
"image": {
"type": "string",
"description": "Image URL representing the product."
}
},
"example": {
"name": "Puma",
"id": 1
}
},
"CatalogDictionary": {
"type": "object",
"properties": {
"productDictionary": {
"type": "object",
"description": "Dictionary of products",
"additionalProperties": {
"$ref": "#/definitions/Product"
}
}
}
},
"CatalogArray": {
"type": "object",
"properties": {
"productArray": {
"description": "Array of products",
"type": "array",
"items": {
"$ref": "#/definitions/Product"
}
}
}
},
"CatalogArrayOfDictionary": {
"type": "object",
"properties": {
"productArrayOfDictionary": {
"description": "Array of dictionary of products",
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Product"
}
}
}
}
},
"CatalogDictionaryOfArray": {
"type": "object",
"properties": {
"productDictionaryOfArray": {
"type": "object",
"description": "Dictionary of Array of product",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/Product"
}
}
}
}
},
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
},
"parameters": {
"SubscriptionIdParamterer": {
"name": "subscriptionId",
"in": "path",
"description": "Subscription ID.",
"required": true,
"type": "string",
"enum": [ "123456" ]
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"description": "API ID.",
"required": true,
"type": "string",
"enum": [ "2014-04-01-preview" ]
}
}
}

Просмотреть файл

@ -0,0 +1,734 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Swagger Constant Service",
"description": "Test Infrastructure for AutoRest Swagger Constant",
"version": "1.0.0"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"paths": {
"/constants/putNoModelAsStringNoRequiredTwoValueNoDefault": {
"put": {
"operationId": "contants_putNoModelAsStringNoRequiredTwoValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum",
"modelAsString": false
},
"required": false
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putNoModelAsStringNoRequiredTwoValueDefault": {
"put": {
"operationId": "contants_putNoModelAsStringNoRequiredTwoValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredTwoValueDefaultOpEnum",
"modelAsString": false
},
"required": false,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putNoModelAsStringNoRequiredOneValueNoDefault": {
"put": {
"operationId": "contants_putNoModelAsStringNoRequiredOneValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredOneValueNoDefaultOpEnum",
"modelAsString": false
},
"required": false
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putNoModelAsStringNoRequiredOneValueDefault": {
"put": {
"operationId": "contants_putNoModelAsStringNoRequiredOneValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredOneValueDefaultOpEnum",
"modelAsString": false
},
"required": false,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putNoModelAsStringRequiredTwoValueNoDefault": {
"put": {
"operationId": "contants_putNoModelAsStringRequiredTwoValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredTwoValueNoDefaultOpEnum",
"modelAsString": false
},
"required": true
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putNoModelAsStringRequiredTwoValueDefault": {
"put": {
"operationId": "contants_putNoModelAsStringRequiredTwoValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredTwoValueDefaultOpEnum",
"modelAsString": false
},
"required": true,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putNoModelAsStringRequiredOneValueNoDefault": {
"put": {
"operationId": "contants_putNoModelAsStringRequiredOneValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredOneValueNoDefaultOpEnum",
"modelAsString": false
},
"required": true
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putNoModelAsStringRequiredOneValueDefault": {
"put": {
"operationId": "contants_putNoModelAsStringRequiredOneValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredOneValueDefaultOpEnum",
"modelAsString": false
},
"required": true,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringNoRequiredTwoValueNoDefault": {
"put": {
"operationId": "contants_putModelAsStringNoRequiredTwoValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredTwoValueNoDefaultOpEnum",
"modelAsString": true
},
"required": false
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringNoRequiredTwoValueDefault": {
"put": {
"operationId": "contants_putModelAsStringNoRequiredTwoValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredTwoValueDefaultOpEnum",
"modelAsString": true
},
"required": false,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringNoRequiredOneValueNoDefault": {
"put": {
"operationId": "contants_putModelAsStringNoRequiredOneValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredOneValueNoDefaultOpEnum",
"modelAsString": true
},
"required": false
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringNoRequiredOneValueDefault": {
"put": {
"operationId": "contants_putModelAsStringNoRequiredOneValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredOneValueDefaultOpEnum",
"modelAsString": true
},
"required": false,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringRequiredTwoValueNoDefault": {
"put": {
"operationId": "contants_putModelAsStringRequiredTwoValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredTwoValueNoDefaultOpEnum",
"modelAsString": true
},
"required": true
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringRequiredTwoValueDefault": {
"put": {
"operationId": "contants_putModelAsStringRequiredTwoValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredTwoValueDefaultOpEnum",
"modelAsString": true
},
"required": true,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringRequiredOneValueNoDefault": {
"put": {
"operationId": "contants_putModelAsStringRequiredOneValueNoDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredOneValueNoDefaultOpEnum",
"modelAsString": true
},
"required": true
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
},
"/constants/putModelAsStringRequiredOneValueDefault": {
"put": {
"operationId": "contants_putModelAsStringRequiredOneValueDefault",
"summary": "Puts constants to the testserver",
"parameters": [
{
"name": "input",
"in": "query",
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredOneValueDefaultOpEnum",
"modelAsString": true
},
"required": true,
"x-ms-client-default": "value1"
}
],
"responses": {
"201": {
"description": "Indicates success."
}
}
}
}
},
"definitions": {
"NoModelAsStringNoRequiredTwoValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredTwoValueNoDefaultEnum",
"modelAsString": false
}
}
}
},
"NoModelAsStringNoRequiredTwoValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredTwoValueDefaultEnum",
"modelAsString": false
},
"x-ms-client-default": "value1"
}
}
},
"NoModelAsStringNoRequiredOneValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredOneValueNoDefaultEnum",
"modelAsString": false
}
}
}
},
"NoModelAsStringNoRequiredOneValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringNoRequiredOneValueDefaultEnum",
"modelAsString": false
},
"x-ms-client-default": "value1"
}
}
},
"NoModelAsStringRequiredTwoValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredTwoValueNoDefaultEnum",
"modelAsString": false
}
}
},
"required": [
"parameter"
]
},
"NoModelAsStringRequiredTwoValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredTwoValueDefaultEnum",
"modelAsString": false
},
"x-ms-client-default": "value1"
}
},
"required": [
"parameter"
]
},
"NoModelAsStringRequiredOneValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredOneValueNoDefaultEnum",
"modelAsString": false
}
}
},
"required": [
"parameter"
]
},
"NoModelAsStringRequiredOneValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "NoModelAsStringRequiredOneValueDefaultEnum",
"modelAsString": false
},
"x-ms-client-default": "value1"
}
},
"required": [
"parameter"
]
},
"ModelAsStringNoRequiredTwoValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredTwoValueNoDefaultEnum",
"modelAsString": true
}
}
}
},
"ModelAsStringNoRequiredTwoValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredTwoValueDefaultEnum",
"modelAsString": true
},
"x-ms-client-default": "value1"
}
}
},
"ModelAsStringNoRequiredOneValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredOneValueNoDefaultEnum",
"modelAsString": true
}
}
}
},
"ModelAsStringNoRequiredOneValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringNoRequiredOneValueDefaultEnum",
"modelAsString": true
},
"x-ms-client-default": "value1"
}
}
},
"ModelAsStringRequiredTwoValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredTwoValueNoDefaultEnum",
"modelAsString": true
}
}
},
"required": [
"parameter"
]
},
"ModelAsStringRequiredTwoValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1",
"value2"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredTwoValueDefaultEnum",
"modelAsString": true
},
"x-ms-client-default": "value1"
}
},
"required": [
"parameter"
]
},
"ModelAsStringRequiredOneValueNoDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredOneValueNoDefaultEnum",
"modelAsString": true
}
}
},
"required": [
"parameter"
]
},
"ModelAsStringRequiredOneValueDefault": {
"type": "object",
"properties": {
"parameter": {
"type": "string",
"enum": [
"value1"
],
"x-ms-enum": {
"name": "ModelAsStringRequiredOneValueDefaultEnum",
"modelAsString": true
},
"x-ms-client-default": "value1"
}
},
"required": [
"parameter"
]
}
}
}

Просмотреть файл

@ -0,0 +1,109 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Parameterized Custom Host Test Client",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"x-ms-parameterized-host": {
"hostTemplate": "{vault}{secret}{dnsSuffix}",
"useSchemePrefix": false,
"parameters": [
{
"name": "vault",
"description": "The vault name, e.g. https://myvault",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true
},
{
"name": "secret",
"description": "Secret value.",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true
},
{
"$ref": "#/parameters/dnsSuffix"
}
]
},
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/customuri/{subscriptionId}/{keyName}": {
"get": {
"operationId": "paths_getEmpty",
"description": "Get a 200 to test a valid base uri",
"tags": [
"Path Operations"
],
"parameters": [
{
"name": "keyName",
"in": "path",
"required": true,
"type": "string",
"description": "The key name with value 'key1'."
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"name": "keyVersion",
"in": "query",
"required": false,
"type": "string",
"default": "v1",
"description": "The key version. Default value 'v1'."
}
],
"responses": {
"200": {
"description": "Successfully received a 200 response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "The subscription id with value 'test12'."
},
"dnsSuffix": {
"name": "dnsSuffix",
"description": "A string value that is used as a global part of the parameterized host. Default value 'host'.",
"type": "string",
"required": true,
"default": "host",
"in": "path",
"x-ms-skip-url-encoding": true
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,172 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Parameterized Host Test Paging Client",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "badhost",
"x-ms-parameterized-host": {
"hostTemplate": "{accountName}{host}",
"positionInOperation": "last",
"parameters": [
{
"name": "accountName",
"description": "Account Name",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true
},
{
"$ref": "#/parameters/host"
}
]
},
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/paging/customurl/partialnextlink": {
"get": {
"operationId": "Paging_getPagesPartialUrl",
"description": "A paging operation that combines custom url, paging and partial URL and expect to concat after host",
"x-ms-examples": {
"Paging_getPagesPartialUrl": {
"$ref": "./examples/Paging_getPagesPartialUrl.json"
}
},
"responses": {
"200": {
"description": "Paging response with a fragment nextLink",
"schema": {
"$ref": "#/definitions/ProductResult"
}
},
"default": {
"description": "Unexpected error"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "values"
}
}
},
"/paging/customurl/partialnextlinkop": {
"get": {
"operationId": "Paging_getPagesPartialUrlOperation",
"description": "A paging operation that combines custom url, paging and partial URL with next operation",
"x-ms-examples": {
"Paging_getPagesPartialUrlOperation": {
"$ref": "./examples/Paging_getPagesPartialUrlOperation.json"
}
},
"responses": {
"200": {
"description": "Paging response with a fragment nextLink",
"schema": {
"$ref": "#/definitions/ProductResult"
}
},
"default": {
"description": "Unexpected error"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "values",
"operationName": "Paging_getPagesPartialUrlOperationNext"
}
}
}
},
"x-ms-paths": {
"/paging/customurl/{nextLink}?Paging_getPagesPartialUrlOperationNext": {
"get": {
"operationId": "Paging_getPagesPartialUrlOperationNext",
"description": "A paging operation that combines custom url, paging and partial URL",
"parameters": [
{
"name": "nextLink",
"in": "path",
"required": true,
"type": "string",
"description": "Next link for the list operation.",
"x-ms-skip-url-encoding": true
}
],
"responses": {
"200": {
"description": "Paging response with a fragment nextLink",
"schema": {
"$ref": "#/definitions/ProductResult"
}
},
"default": {
"description": "Unexpected error"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "values",
"operationName": "Paging_getPagesPartialUrlOperationNext"
}
}
}
},
"parameters": {
"host": {
"name": "host",
"description": "A string value that is used as a global part of the parameterized host",
"type": "string",
"required": true,
"default": "host",
"in": "path",
"x-ms-skip-url-encoding": true
}
},
"definitions": {
"ProductResult": {
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "#/definitions/Product"
}
},
"nextLink": {
"type": "string"
}
}
},
"Product": {
"type": "object",
"properties": {
"properties": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
}
}
},
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,80 @@
{
"swagger": "2.0",
"info": {
"title": "AutoRest Parameterized Host Test Client",
"description": "Test Infrastructure for AutoRest",
"version": "1.0.0"
},
"host": "badhost",
"x-ms-parameterized-host": {
"hostTemplate": "{accountName}{host}",
"positionInOperation": "last",
"parameters": [
{
"name": "accountName",
"description": "Account Name",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true
},
{
"$ref": "#/parameters/host"
}
]
},
"produces": [ "application/json" ],
"consumes": [ "application/json" ],
"paths": {
"/customuri": {
"get": {
"operationId": "paths_getEmpty",
"description": "Get a 200 to test a valid base uri",
"x-ms-examples": {
"paths_getEmpty": {
"$ref": "./examples/paths_getEmpty.json"
}
},
"tags": [
"Path Operations"
],
"responses": {
"200": {
"description": "Successfully received a 200 response"
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"parameters": {
"host": {
"name": "host",
"description": "A string value that is used as a global part of the parameterized host",
"type": "string",
"required": true,
"default": "host",
"in": "path",
"x-ms-skip-url-encoding": true
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": 429.1
}
}
}

Просмотреть файл

@ -0,0 +1,10 @@
{
"parameters": {
"input": 200.4
},
"responses": {
"200": {
"body": "Nice job posting a float enum"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": 429
}
}
}

Просмотреть файл

@ -0,0 +1,10 @@
{
"parameters": {
"input": 200
},
"responses": {
"200": {
"body": "Nice job posting an int enum"
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
{
"parameters": {
"accountName": "testaccount"
},
"responses": {
"200": {
"body": {
"values":[
{
"properties":{
"id":1,
"name":"Product"
}
}
],
"nextLink":"/paging/customurl/partialnextlink/page/2"
}
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
{
"parameters": {
"accountName": "testaccount"
},
"responses": {
"200": {
"body": {
"values":[
{
"properties":{
"id":1,
"name":"Product"
}
}
],
"nextLink":"partialnextlinkop/page/2"
}
}
}
}

Просмотреть файл

@ -0,0 +1,12 @@
{
"parameters": {
"petParam": {
"name": "Retriever",
"DaysOfWeek": "Monday",
"IntEnum": "1"
}
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,14 @@
{
"parameters": {
"petId": "tommy"
},
"responses": {
"200": {
"body": {
"name": "Retriever",
"DaysOfWeek": "Monday",
"IntEnum": "1"
}
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": false
}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"parameters": {},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
{
"parameters": {
},
"responses": {
"200": {
"body": true
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"boolBody": false
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
{
"parameters": {
"boolBody": true
},
"responses": {
"200": {
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "::::SWAGGER::::"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "//79/Pv6+fj39g=="
}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"parameters": {},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"byteBody": "//79/Pv6+fj39g=="
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "9999-12-31"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "0001-01-01"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"dateBody": "9999-12-31"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"dateBody": "0001-01-01"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "0001-01-01T00:00:00-14:00"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "0001-01-01T00:00:00"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "9999-12-31t23:59:59.999+14:00"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "9999-12-31T23:59:59.999+14:00"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "9999-12-31t23:59:59.999z"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "0001-01-01T00:00:00Z"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "9999-12-31T23:59:59.999Z"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"datetimeBody": "0001-01-01T00:00:00-14:00"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"datetimeBody": "9999-12-31T23:59:59.999+14:00"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"datetimeBody": "9999-12-31T23:59:59.999Z"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"datetimeBody": "0001-01-01T00:00:00Z"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "fri, 31 dec 9999 23:59:59 gmt"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "Mon, 1 Jan 0001 00:00:00 GMT"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "FRI, 31 DEC 9999 23:59:59 GMT"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"datetimeBody": "Fri, 31 Dec 9999 23:59:59 GMT"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"datetimeBody": "Mon, 1 Jan 0001 00:00:00 GMT"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "P3Y6M4DT12H30M5S"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"durationBody": "P123DT22H14M12.011S"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "red color"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "red color"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": "green-color"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"stringBody": "red color"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"enumStringBody": "red color"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {
"enumStringBody": "green-color"
},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"parameters": {},
"responses": {
"200": {
"body": ""
}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"parameters": {},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"parameters": {},
"responses": {
"204": {}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"parameters": {},
"responses": {
"200": {}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"parameters": {},
"responses": {
"204": {}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше