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

Add preliminary API for OriginStamp service #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
136 changes: 136 additions & 0 deletions open-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
openapi: 3.0.0
info:
description: This is a preliminary API for the OriginStamp service
version: "0.0.1"
title: OriginStamp
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
tags:
- name: recipients
description: bla bla bla chistoffer bla bla bla

paths:
/v1/recipients:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be bulk?

post:
summary: Creates a new recipient
description: Create a new recipient to allow Stamp to issue certificates to the recipients wallet.
operationId: CreateRecipient
tags:
- recipients
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/recipientPost'
responses:
'201':
description: Recipient created
content:
application/json:
schema:
$ref: '#/components/schemas/recipientCreated'
'400':
description: Invalid create request

/v1/certificates:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this a bulk?

post:
summary: Queues a certificate to be issued to a recipient
description: Queues a certificate to be issued to the registry and recipients wallet.
operationId: IssueCertificate
tags:
- issue
requestBody:
content:
application/json:
schema:
type: object
properties:
recipient:
type: string
format: uuid
example: f5d8ee39-0f64-4a8f-9d4e-e25b8f3a5b3f
certificate:
$ref: '#/components/schemas/certificate'
responses:
'202':
description: Accepted for issuance.
'400':
description: Invalid issuance request.

components:
schemas:
certificate:
type: object
properties:
type:
type: string
enum: [production, consumption]
quantity:
description: "The number of watt hours on the certificate"
type: integer
format: int64
example: 1200
start:
description: "The start of the time range in Unix time in seconds."
type: integer
format: int64
example: 1641376800
end:
description: "The end of the time range in Unix time in seconds."
type: integer
format: int64
example: 1641380400
gridArea:
type: string
description: "The grid area of where the certificate exists within"
example: "DK1"
clearTextAttributes:
description: "Attributes to be added to the certificate that are clear-text and everyone can see."
type: object
additionalProperties:
type: string
example:
fuelCode: "F1023433"
techCode: "T1023431"
hashedAttributes:
description: "Attributes that are only viewable by an owner given access to the attribute."
type: object
additionalProperties:
type: string
example:
assetId: "123456789"

recipientPost:
type: object
required:
- walletEndpointReference
properties:
walletEndpointReference:
$ref: '#/components/schemas/walletEndpointReference'

recipientCreated:
type: object
properties:
id:
type: string
format: uuid
example: f5d8ee39-0f64-4a8f-9d4e-e25b8f3a5b3f

walletEndpointReference:
type: object
required:
- endpoint
- publicKey
- version
properties:
version:
type: integer
example: 1
endpoint:
type: string
format: url
example: https://example.com/wallet
publicKey:
type: string
example: c2FydGhzdGhyc3J1amhzcnR2anNyeXRqc2pydHk=