forked from linode/linode-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: Add support for loading JSON OpenAPI spec files (linode#629)
- Loading branch information
1 parent
6d49b6e
commit 19ee0b7
Showing
12 changed files
with
333 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
FROM python:3.11-slim AS builder | ||
|
||
ARG linode_cli_version | ||
|
||
ARG github_token | ||
|
||
WORKDIR /src | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "API Specification", | ||
"version": "1.0.0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost/v4" | ||
} | ||
], | ||
"paths": { | ||
"/foo/bar": { | ||
"get": { | ||
"summary": "get info", | ||
"operationId": "fooBarGet", | ||
"description": "This is description", | ||
"responses": { | ||
"200": { | ||
"description": "Successful response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"data": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/OpenAPIResponseAttr" | ||
} | ||
}, | ||
"page": { | ||
"$ref": "#/components/schemas/PaginationEnvelope/properties/page" | ||
}, | ||
"pages": { | ||
"$ref": "#/components/schemas/PaginationEnvelope/properties/pages" | ||
}, | ||
"results": { | ||
"$ref": "#/components/schemas/PaginationEnvelope/properties/results" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"OpenAPIResponseAttr": { | ||
"type": "object", | ||
"properties": { | ||
"filterable_result": { | ||
"x-linode-filterable": true, | ||
"type": "string", | ||
"description": "Filterable result value" | ||
}, | ||
"filterable_list_result": { | ||
"x-linode-filterable": true, | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "Filterable result value" | ||
} | ||
} | ||
}, | ||
"PaginationEnvelope": { | ||
"type": "object", | ||
"properties": { | ||
"pages": { | ||
"type": "integer", | ||
"readOnly": true, | ||
"description": "The total number of pages.", | ||
"example": 1 | ||
}, | ||
"page": { | ||
"type": "integer", | ||
"readOnly": true, | ||
"description": "The current page.", | ||
"example": 1 | ||
}, | ||
"results": { | ||
"type": "integer", | ||
"readOnly": true, | ||
"description": "The total number of results.", | ||
"example": 1 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: API Specification | ||
version: 1.0.0 | ||
servers: | ||
- url: http://localhost/v4 | ||
paths: | ||
/foo/bar: | ||
get: | ||
summary: get info | ||
operationId: fooBarGet | ||
description: This is description | ||
responses: | ||
'200': | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/OpenAPIResponseAttr' | ||
page: | ||
$ref: '#/components/schemas/PaginationEnvelope/properties/page' | ||
pages: | ||
$ref: '#/components/schemas/PaginationEnvelope/properties/pages' | ||
results: | ||
$ref: '#/components/schemas/PaginationEnvelope/properties/results' | ||
|
||
components: | ||
schemas: | ||
OpenAPIResponseAttr: | ||
type: object | ||
properties: | ||
filterable_result: | ||
x-linode-filterable: true | ||
type: string | ||
description: Filterable result value | ||
filterable_list_result: | ||
x-linode-filterable: true | ||
type: array | ||
items: | ||
type: string | ||
description: Filterable result value | ||
PaginationEnvelope: | ||
type: object | ||
properties: | ||
pages: | ||
type: integer | ||
readOnly: true | ||
description: The total number of pages. | ||
example: 1 | ||
page: | ||
type: integer | ||
readOnly: true | ||
description: The current page. | ||
example: 1 | ||
results: | ||
type: integer | ||
readOnly: true | ||
description: The total number of results. | ||
example: 1 |
Oops, something went wrong.