Skip to content

Commit

Permalink
feat: implemented schema endpoints (#1)
Browse files Browse the repository at this point in the history
* feat: added schema endpoints

* feat: implemented schema endpoints

* style: prettier

* feat: PR changes

* test: fix import path
  • Loading branch information
CptSchnitz authored Apr 30, 2024
1 parent 9e5f9aa commit 02ccad7
Show file tree
Hide file tree
Showing 22 changed files with 961 additions and 475 deletions.
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

0 comments on commit 02ccad7

Please sign in to comment.