An error occurred while loading the file. Please try again.
-
Tejash JL authoredUnverified46f007cc
openapi: 3.0.1
info:
title: Sunbird RC - Schema APIs
description: Schema APIs
termsOfService: https://sunbirdrc.dev/
contact:
email: sunbird@example.com
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: https://sunbirdrc.dev/api/v1
security:
- Authorization: []
tags:
- name: Credential Schemas
- name: Rendering Templates
paths:
/credential-schema:
post:
tags:
- Credential Schemas
summary: Create credential schema
operationId: createCredentialSchema
requestBody:
description: Payload
content:
'appliation/json':
schema:
$ref: '#/components/schemas/credentialSchemaRequest'
required: true
responses:
201:
description: Credential Schema successfully created!
content:
'application/json':
schema:
$ref: '#/components/schemas/credentialSchemaResponse'
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
get:
tags:
- Credential Schemas
summary: Get credential schema by tags
operationId: getCredentialSchemas
parameters:
- in: query
name: tags
schema:
type: string
example: tag1,tag2
responses:
201:
description: Credential Schemas
content:
'application/json':
schema:
type: array
items:
$ref: '#/components/schemas/credentialSchemaResponse'
400:
description: Invalid Input
content: {}
500:
description: error
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
content: {}
/credential-schema/{id}:
get:
tags:
- Credential Schemas
summary: Get credential schema by id
operationId: getCredentialSchema
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
description: Response
content:
'application/json':
schema:
$ref: '#/components/schemas/credentialSchemaResponse'
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
put:
tags:
- Credential Schemas
summary: Update credential schema by id
description: If the schema is updated, a new semver will be generated and the old one will be deprecated. If only metadata (like tags/status) is updated, the semver will not be generated
operationId: updateCredentialSchema
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
description: Payload
content:
'appliation/json':
schema:
$ref: '#/components/schemas/credentialSchemaRequest'
required: true
responses:
200:
description: Credential Schema successfully updated!
content:
'application/json':
schema:
allOf:
- $ref: '#/components/schemas/credentialSchemaResponse'
- type: object
properties:
deprecatedId:
description: returns back the id of the schema that was deprecated
type: string
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
/template:
post:
tags:
- Rendering Templates
summary: Create redenring templates
operationId: createRenderingTemplates
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
requestBody:
description: Payload
content:
'appliation/json':
schema:
$ref: '#/components/schemas/renderingTemplateRequest'
required: true
responses:
201:
description: Rendering template successfully created!
content:
'application/json':
schema:
$ref: '#/components/schemas/renderingTemplateResponse'
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
get:
tags:
- Rendering Templates
summary: Get rendering templates by schema id
operationId: getRenderingTemplatesBySchemaId
parameters:
- name: schemaId
in: query
required: true
schema:
type: string
responses:
200:
description: Response
content:
'application/json':
schema:
$ref: '#/components/schemas/renderingTemplateResponse'
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
/template/{id}:
get:
tags:
- Rendering Templates
summary: Get rendering templates by id
operationId: getRenderingTemplates
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
description: Response
content:
'application/json':
schema:
$ref: '#/components/schemas/renderingTemplateResponse'
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
put:
211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
tags:
- Rendering Templates
summary: Update rendering templates by id
description: Create a new version of template
operationId: updateRenderingTemplates
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
description: Payload
content:
'appliation/json':
schema:
$ref: '#/components/schemas/renderingTemplateRequest'
required: true
responses:
200:
description: Rendering template successfully updated!
content:
'application/json':
schema:
$ref: '#/components/schemas/renderingTemplateResponse'
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
delete:
tags:
- Rendering Templates
summary: Delete rendering templates by id
operationId: deleteRenderingTemplates
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
200:
description: Credential Schema successfully deleted!
400:
description: Invalid Input
content: {}
500:
description: error
content: {}
components:
schemas:
renderingTemplateResponse:
allOf:
- $ref: '#/components/schemas/renderingTemplateRequest'
- type: object
properties:
templateId:
type: string
example: "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1"
createdAt:
type: string
updatedAt:
type: string
createdBy:
type: string
updatedBy:
type: string
281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
renderingTemplateRequest:
type: object
properties:
template:
description: It should be valid string in handlebar format
type: string
schemaId:
type: string
example: "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1"
updateSchemaRequest:
type: object
properties:
tags:
type: array
items:
type: string
status:
type: string
enum: [DRAFT,PUBLISHED, REVOKED]
credentialSchemaRequest:
type: object
properties:
schema:
type: object
properties:
type:
type: string
id:
type: string
pattern: "^\\d+\\.\\d+$"
example: "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1"
version:
type: string
name:
type: string
author:
type: string
authored:
type: string
schema:
type: object
example: '{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Email","type":"object","properties":{"emailAddress":{"type":"string","format":"email"}},"required":["emailAddress"],"additionalProperties":false}'
tags:
type: array
items:
type: string
status:
type: string
enum: [DRAFT,PUBLISHED, REVOKED]
credentialSchemaResponse:
type: object
properties:
schema:
type: object
properties:
type:
type: string
id:
type: string
pattern: "^\\d+\\.\\d+$"
example: "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1"
version:
type: string
name:
type: string
author:
type: string
authored:
type: string
351352353354355356357358359360361362363364365366367368369370371372373374375376
schema:
type: object
example: '{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"Email","type":"object","properties":{"emailAddress":{"type":"string","format":"email"}},"required":["emailAddress"],"additionalProperties":false}'
proof:
type: object
tags:
type: array
items:
type: string
status:
type: string
enum: [DRAFT,PUBLISHED, REVOKED]
createdAt:
type: string
updatedAt:
type: string
createdBy:
type: string
updatedBy:
type: string
securitySchemes:
Authorization:
type: apiKey
name: Token
in: header