Skip to content
Merged
Show file tree
Hide file tree
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
35 changes: 35 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Validate API Specs

on:
pull_request:
paths:
- "reference/**"
- "redocly.yaml"
- "package.json"
push:
branches: [main]
paths:
- "reference/**"
- "redocly.yaml"
- "package.json"

jobs:
validate:
name: Lint & Validate
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- run: npm ci

- name: Lint OpenAPI specs
run: npm run lint:openapi

- name: Validate JSON schemas
run: npm run lint:schemas
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
.worktrees
node_modules/
108 changes: 108 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "api-specs",
"version": "1.0.0",
"private": true,
"description": "Precog API specifications",
"scripts": {
"lint": "npm run lint:openapi && npm run lint:schemas",
"lint:openapi": "redocly lint reference/*.yaml",
"lint:schemas": "node scripts/validate-json-schemas.mjs"
},
"devDependencies": {
"@redocly/cli": "^2.41.0",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1"
}
}
18 changes: 18 additions & 0 deletions redocly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
extends:
- recommended

rules:
no-ambiguous-paths: off
no-server-example.com: off
no-http-verbs-in-paths: warn
no-identical-paths: error
no-undefined-server-variable: error
operation-4xx-response: warn
path-not-include-query: error

# Relax some recommended rules that may be too strict initially
info-contact: warn
info-license: off
operation-operationId-unique: error
operation-operationId: warn
tag-description: warn
18 changes: 0 additions & 18 deletions reference/admin-http-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,24 +280,6 @@ components:
$ref: '#/components/schemas/applies-to'
toOverride:
$ref: '#/components/schemas/job-args-to-override'

error-message:
title: error-message
type: object
properties:
error:
type: object
required:
- type
- details
properties:
type:
type: string
minLength: 1
details:
type: string
required:
- error
securitySchemes:
BearerAuth:
type: http
Expand Down
33 changes: 13 additions & 20 deletions reference/metadata-http-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ paths:
primaryKey: [ id_example, array_index ]
foreignKeys:
example:
- local: [ id_example ]
- reference: [ id ]
local: [ id_example ]
reference: [ id ]
columns:
- columnName: id_example
columnType: string
Expand Down Expand Up @@ -244,24 +244,17 @@ components:
type: object
title: pipeline dataset properties
properties:
primaryKey:
type: object
description: A primary key property
properties:
type:
oneOf:
- type: string
enum: [strict, optional]
description: Indicates whether the key is strict or optional
components:
type: array
title: Primary key components
items:
type: string
minLength: 1
required: [type, components]
required: [primaryKey]
additionalProperties: false
type:
type: string
enum: [strict, optional]
description: Indicates whether the key is strict or optional
components:
type: array
title: Primary key components
items:
type: string
minLength: 1
required: [type, components]

securitySchemes:
BearerAuth:
Expand Down
Loading
Loading