Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions __tests__/__snapshots__/json-schema.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ exports[`Example > JSON Schema snapshot 1`] = `
],
"type": "object",
},
"Binary": {
"format": "binary",
"type": "string",
},
"CreateUserRequest": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -52,6 +56,11 @@ exports[`Example > JSON Schema snapshot 1`] = `
"Id": {
"type": "string",
},
"RateLimit": {
"format": "int32",
"minimum": 0,
"type": "integer",
},
"UpdateUserRequest": {
"additionalProperties": false,
"minProperties": 1,
Expand Down
287 changes: 287 additions & 0 deletions __tests__/__snapshots__/openapi-schema.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
exports[`Example > OpenAPI 1`] = `
{
"components": {
"headers": {
"x-rate-limit": {
"description": "Number of requests allowed per hour",
"required": true,
"schema": {
"$ref": "#/components/schemas/RateLimit",
},
},
"x-rate-limit-remaining": {
"description": "Number of requests remaining in the current window",
"schema": {
"$ref": "#/components/schemas/RateLimit",
},
},
},
"parameters": {
"UserId": {
"in": "path",
Expand All @@ -29,6 +44,10 @@ exports[`Example > OpenAPI 1`] = `
],
"type": "object",
},
"Binary": {
"format": "binary",
"type": "string",
},
"CreateUserRequest": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -62,6 +81,11 @@ exports[`Example > OpenAPI 1`] = `
"Id": {
"type": "string",
},
"RateLimit": {
"format": "int32",
"minimum": 0,
"type": "integer",
},
"UpdateUserRequest": {
"additionalProperties": false,
"minProperties": 1,
Expand Down Expand Up @@ -142,6 +166,21 @@ exports[`Example > OpenAPI 1`] = `
},
},
"description": "User 200 response",
"headers": {
"x-rate-limit": {
"description": "Number of requests allowed per hour",
"required": true,
"schema": {
"$ref": "#/components/schemas/RateLimit",
},
},
"x-rate-limit-remaining": {
"description": "Number of requests remaining in the current window",
"schema": {
"$ref": "#/components/schemas/RateLimit",
},
},
},
},
},
"tags": [
Expand Down Expand Up @@ -250,6 +289,63 @@ exports[`Example > OpenAPI 1`] = `
"tags": [],
},
},
"/users/{userId}/avatar": {
"get": {
"description": "Download user avatar as JSON metadata or raw binary",
"operationId": "getUserAvatarCommand",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User",
},
},
"application/octet-stream": {
"schema": {
"$ref": "#/components/schemas/Binary",
},
},
},
"description": "Avatar response",
},
},
"tags": [],
},
"parameters": [
{
"$ref": "#/components/parameters/UserId",
},
],
"put": {
"description": "Upload user avatar as binary",
"operationId": "uploadUserAvatarCommand",
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"$ref": "#/components/schemas/Binary",
},
},
},
"description": "",
"required": true,
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User",
},
},
},
"description": "Successful response",
},
},
"tags": [],
},
},
},
"security": [
{
Expand Down Expand Up @@ -281,6 +377,25 @@ exports[`Example > OpenAPI 1`] = `
exports[`Example > Swagger Parser validate 1`] = `
{
"components": {
"headers": {
"x-rate-limit": {
"description": "Number of requests allowed per hour",
"required": true,
"schema": {
"format": "int32",
"minimum": 0,
"type": "integer",
},
},
"x-rate-limit-remaining": {
"description": "Number of requests remaining in the current window",
"schema": {
"format": "int32",
"minimum": 0,
"type": "integer",
},
},
},
"parameters": {
"UserId": {
"in": "path",
Expand All @@ -307,6 +422,10 @@ exports[`Example > Swagger Parser validate 1`] = `
],
"type": "object",
},
"Binary": {
"format": "binary",
"type": "string",
},
"CreateUserRequest": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -352,6 +471,11 @@ exports[`Example > Swagger Parser validate 1`] = `
"Id": {
"type": "string",
},
"RateLimit": {
"format": "int32",
"minimum": 0,
"type": "integer",
},
"UpdateUserRequest": {
"additionalProperties": false,
"minProperties": 1,
Expand Down Expand Up @@ -538,6 +662,25 @@ exports[`Example > Swagger Parser validate 1`] = `
},
},
"description": "User 200 response",
"headers": {
"x-rate-limit": {
"description": "Number of requests allowed per hour",
"required": true,
"schema": {
"format": "int32",
"minimum": 0,
"type": "integer",
},
},
"x-rate-limit-remaining": {
"description": "Number of requests remaining in the current window",
"schema": {
"format": "int32",
"minimum": 0,
"type": "integer",
},
},
},
},
},
"tags": [
Expand Down Expand Up @@ -835,6 +978,148 @@ exports[`Example > Swagger Parser validate 1`] = `
"tags": [],
},
},
"/users/{userId}/avatar": {
"get": {
"description": "Download user avatar as JSON metadata or raw binary",
"operationId": "getUserAvatarCommand",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"address": {
"additionalProperties": false,
"properties": {
"postcode": {
"format": "int32",
"maximum": 9999,
"minimum": 1000,
"type": "integer",
},
},
"required": [
"postcode",
],
"type": "object",
},
"age": {
"anyOf": [
{
"format": "int32",
"minimum": 0,
"type": "integer",
},
{
"type": "null",
},
],
},
"name": {
"type": "string",
},
"userId": {
"type": "string",
},
},
"required": [
"name",
],
"type": "object",
},
},
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string",
},
},
},
"description": "Avatar response",
},
},
"tags": [],
},
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"schema": {
"type": "string",
},
},
],
"put": {
"description": "Upload user avatar as binary",
"operationId": "uploadUserAvatarCommand",
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string",
},
},
},
"description": "",
"required": true,
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": false,
"properties": {
"address": {
"additionalProperties": false,
"properties": {
"postcode": {
"format": "int32",
"maximum": 9999,
"minimum": 1000,
"type": "integer",
},
},
"required": [
"postcode",
],
"type": "object",
},
"age": {
"anyOf": [
{
"format": "int32",
"minimum": 0,
"type": "integer",
},
{
"type": "null",
},
],
},
"name": {
"type": "string",
},
"userId": {
"type": "string",
},
},
"required": [
"name",
],
"type": "object",
},
},
},
"description": "Successful response",
},
},
"tags": [],
},
},
},
"security": [
{
Expand Down Expand Up @@ -866,6 +1151,7 @@ exports[`Example > Swagger Parser validate 1`] = `
exports[`Note Taking > OpenAPI 1`] = `
{
"components": {
"headers": {},
"parameters": {
"NoteId": {
"in": "path",
Expand Down Expand Up @@ -1353,6 +1639,7 @@ exports[`Note Taking > OpenAPI 1`] = `
exports[`Note Taking > Swagger Parser validate 1`] = `
{
"components": {
"headers": {},
"parameters": {
"NoteId": {
"in": "path",
Expand Down
Loading
Loading