Skip to content

Commit

Permalink
begin alignment with new API
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed Dec 4, 2023
1 parent 99540f3 commit 0d47b9a
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 252 deletions.
73 changes: 73 additions & 0 deletions alfalfa_web/components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
components:
schemas:
runId:
type: string
pointId:
type: string
format: uuid
pointName:
type: string
default: Outdoor Air Temperature Sensor
pointType:
type: string
enum:
- "input"
- "output"
- "bidirectional"
runMetadata:
type: object
properties:
id:
$ref: "#/components/schemas/runId"
pointMetadata:
type: object
properties:
id:
$ref: "#/components/schemas/pointId"
name:
$ref: "#/components/schemas/pointName"
description:
type: string
default: An outdoor air temperature sensor for an air handling unit
readOnly: true
unit:
type: string
default: °F
readOnly: true
min:
type: number
readOnly: true
max:
type: number
type:
$ref: "#/components/schemas/pointType"
required:
- id
- type
pointValue:
type: object
properties:
id:
$ref: "#/components/schemas/pointId"
value:
type: number
default: 24.3
pointData:
allOf:
- $ref: "#/components/schemas/pointMetadata"
- $ref: "#/components/schemas/pointValue"
parameters:
runId:
in: path
name: runId
schema:
$ref: "#/components/schemas/runId"
required: true
description: UUID of run
pointId:
in: path
name: pointId
schema:
$ref: "#/components/schemas/pointId"
required: true
description: UUID of point
8 changes: 6 additions & 2 deletions alfalfa_web/generate-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { version } = require("./package.json");
const serverType = process.env.NODE_ENV === "production" ? "Production" : "Development";

const openapiSpecification = swaggerJsdoc({
apis: ["./server/api-v2.js", "./server/api-haystack.js"],
apis: ["./server/api-v2.js", "./server/api-haystack.js", "./components.yml"],
definition: {
openapi: "3.1.0",
info: {
Expand Down Expand Up @@ -47,6 +47,10 @@ const openapiSpecification = swaggerJsdoc({
name: "Site",
description: "Manage sites"
},
{
name: "Run",
description: "Manage Runs"
},
{
name: "Haystack",
description:
Expand All @@ -56,7 +60,7 @@ const openapiSpecification = swaggerJsdoc({
"x-tagGroups": [
{
name: "Alfalfa API",
tags: ["About", "Alias", "Model", "Simulation", "Site"]
tags: ["About", "Alias", "Model", "Simulation", "Site", "Run"]
},
{
name: "Project Haystack API",
Expand Down
2 changes: 1 addition & 1 deletion alfalfa_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@redocly/cli": "^1.0.0-beta.124",
"@redocly/cli": "^1.5.0",
"babel-loader": "^9.1.2",
"babel-preset-minify": "^0.5.2",
"before-build-webpack": "^0.2.13",
Expand Down
Loading

0 comments on commit 0d47b9a

Please sign in to comment.