Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implemented schema endpoints #1

Merged
merged 5 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 2 additions & 3 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: config-server
description: A Node.js service that provides configuration data to other services
name: config-server
description: A Node.js service that provides configuration data to other services
annotations:
github.com/project-slug: MapColonies/config-server
tags:
- nodejs
- typescript
- expressjs
- boilerplate
spec:
type: service
lifecycle: production
Expand Down
62 changes: 31 additions & 31 deletions openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,22 @@ paths:
$ref: '#/components/responses/404NotFound'
'500':
$ref: '#/components/responses/500InternalServerError'
/schema/{path}:
/schema:
get:
parameters:
- name: path
in: path
description: The relative path of the schema as defined in the schema id
- name: id
in: query
description: The id of the requested schema
required: true
schema:
type: string
schema:
$ref: '#/components/schemas/schemaId'
- name: shouldDereference
in: query
description: should the schema contain refs
description: should the server bundle all refs into one schema
schema:
type: boolean
operationId: getSchema
summary: return a tree representation of all the schemas
summary: returns the requested schema
responses:
200:
description: OK
Expand All @@ -146,7 +146,7 @@ paths:
$ref: '#/components/responses/404NotFound'
'500':
$ref: '#/components/responses/500InternalServerError'
/schemas:
/schema/tree:
get:
operationId: getSchemasTree
summary: return a tree representation of all the schemas
Expand All @@ -156,7 +156,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/schemaTree"
$ref: '#/components/schemas/schemaTree'
'400':
$ref: '#/components/responses/400BadRequest'
'500':
Expand Down Expand Up @@ -297,7 +297,7 @@ components:
schemaId:
type: string
pattern: "^https:\\/\\/mapcolonies\\.com\\/.+$"
example: "https://mapcolonies.com/common/db/v1"
example: 'https://mapcolonies.com/common/db/v1'
version:
type: string
pattern: '^v[1-9]+[0-9]*$'
Expand All @@ -310,39 +310,39 @@ components:
maxLength: 50
schemaTree:
type: array
example:
example:
- name: common
children:
- name: boilerplate
children:
- name: v1
url: https://mapcolonies.com/common/boilerplate/v1
- name: v2
url: https://mapcolonies.com/common/boilerplate/v2
- name: v3
url: https://mapcolonies.com/common/boilerplate/v3
- name: db
children:
- name: v1
url: https://mapcolonies.com/common/db/v1
- name: boilerplate
children:
- name: v1
url: https://mapcolonies.com/common/boilerplate/v1
- name: v2
url: https://mapcolonies.com/common/boilerplate/v2
- name: v3
url: https://mapcolonies.com/common/boilerplate/v3
- name: db
children:
- name: v1
url: https://mapcolonies.com/common/db/v1

items:
oneOf:
- $ref: "#/components/schemas/schemaTreeItem"
- $ref: "#/components/schemas/schemaTreeDir"
- $ref: '#/components/schemas/schemaTreeItem'
- $ref: '#/components/schemas/schemaTreeDir'
schemaTreeItem:
type: object
properties:
name:
properties:
name:
type: string
id:
type: string
schemaTreeDir:
type: object
properties:
children:
$ref: "#/components/schemas/schemaTree"
name:
$ref: '#/components/schemas/schemaTree'
name:
type: string
config:
type: object
Expand Down
Loading
Loading