Skip to content

Instantly share code, notes, and snippets.

@altitude
Created June 24, 2021 08:00
Show Gist options
  • Save altitude/2c9a19304020ed45f2e24bde8964165e to your computer and use it in GitHub Desktop.
Save altitude/2c9a19304020ed45f2e24bde8964165e to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Goldilocks HTTP API
version: 1.0.0-alpha
components:
schemas:
reference:
type: string
asset:
type: string
account:
type: object
properties:
reference:
$ref: "#/components/schemas/reference"
contract:
$ref: "#/components/schemas/contract"
balances:
type: object
additionalProperties:
type: "integer"
contract:
type: object
properties:
version:
type: string
emits:
type: array
items:
$ref: "#/components/schemas/asset"
transaction:
type: object
properties:
from:
$ref: "#/components/schemas/reference"
to:
$ref: "#/components/schemas/reference"
amount:
type: integer
asset:
$ref: "#/components/schemas/asset"
metadata:
type: object
paths:
/_info:
get:
summary: Show Goldilocks server informations
responses:
200:
description: server info object
content:
application/json:
schema:
type: object
/accounts:
get:
summary: List accounts
responses:
200:
description: The accounts list
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/account"
/accounts/{reference}:
get:
summary: Get an account by its fully-qualified reference
parameters:
- required: true
name: reference
in: path
schema:
$ref: "#/components/schemas/reference"
responses:
200:
description: The account object
content:
application/json:
schema:
$ref: "#/components/schemas/account"
/accounts/{reference}/contract:
put:
summary: Update an account contract
parameters:
- name: reference
required: true
in: path
schema:
$ref: "#/components/schemas/reference"
responses:
200:
description: The contract was succesfully applied
# /namespaces:
# get:
# summary: List namespaces
# responses:
# 200:
# description: The namespaces list
# content:
# application/json:
# schema:
# type: array
# /namespaces/{reference}/contract:
# put:
# summary: Set a namespace default contract
# responses:
# 200:
# description: Success
/transactions:
get:
summary: List transactions
responses:
200:
description: The transactions list
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/transaction"
post:
summary: Commit a new transaction to the ledger
responses:
200:
description: Successfull commit
/audit/violations:
get:
summary: List contracts violations
responses:
200:
description: The violations list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment