Skip to content

Commit 001440b

Browse files
ericfitzclaude
andauthored
refactor: move API schemas to api-schema/ and validation outputs to test/ (#115)
* refactor: move API schemas to api-schema/ and validation outputs to test/ - Move OpenAPI, AsyncAPI, and Arazzo specs from docs/reference/apis to api-schema/ - Move validation reports/databases to test/outputs/api-validation/ - Update all path references in Makefile, scripts, and documentation - Update GitHub URLs in version.go and OpenAPI spec Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: remove obsolete documentation and legacy migrations - Remove inline-schema-analysis.md (outdated) - Remove microsoft-entra-id-saml-claims.json (unused reference) - Remove legacy migration files (superseded by current migrations) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 57b0878 commit 001440b

35 files changed

+46
-1269
lines changed

.github/workflows/security.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ jobs:
8484
- name: Validate OpenAPI specification
8585
run: |
8686
# JSON syntax check
87-
jq empty docs/reference/apis/tmi-openapi.json
87+
jq empty api-schema/tmi-openapi.json
8888
# Vacuum linting with OWASP rules
89-
vacuum lint -r vacuum-ruleset.yaml docs/reference/apis/tmi-openapi.json
89+
vacuum lint -r vacuum-ruleset.yaml api-schema/tmi-openapi.json
9090
9191
dependency-review:
9292
name: Dependency Review

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
!.claude/**
4949
!.github/
5050
!.github/**
51+
!api-schema/
52+
!api-schema/**
5153

5254
# heroku
5355
!.godir
@@ -82,10 +84,6 @@ scripts/configure-heroku-env.sh
8284
.dedupe/
8385
**/__pycache__/
8486
**/*.pyc
85-
docs/reference/apis/openapi-validation-report.json
86-
docs/reference/apis/openapi-validation.db
87-
docs/reference/apis/asyncapi-validation-report.json
88-
8987
# OpenAPI backup files
9088
*.json.backup
9189

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"major": 0,
33
"minor": 272,
4-
"patch": 4
4+
"patch": 6
55
}

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This repository contains API documentation and Go implementation for a Collabora
88

99
## Key Files
1010

11-
- docs/reference/apis/tmi-openapi.json - OpenAPI specification
11+
- api-schema/tmi-openapi.json - OpenAPI specification
1212
- api/store.go - Generic typed map storage implementation
1313
- api/server.go - Main API server with WebSocket support
1414
- api/websocket.go - WebSocket hub for real-time collaboration
@@ -139,7 +139,7 @@ TMI uses [Chainguard](https://chainguard.dev/) container images for enhanced sec
139139
- Use jq to selectively query or modify the openapi schema
140140
- Validate OpenAPI: `make validate-openapi` (validates JSON syntax with jq, then runs Vacuum linting with OWASP rules)
141141
- Requires only `jq` and `vacuum` binaries (no Python or Node.js dependencies)
142-
- Outputs structured JSON report to `docs/reference/apis/openapi-validation-report.json`
142+
- Outputs structured JSON report to `api-schema/openapi-validation-report.json`
143143
- Configuration: `vacuum-ruleset.yaml` (extends `vacuum:oas` recommended + `vacuum:owasp` all)
144144
- **Public Endpoints**: TMI has 17 public endpoints (OAuth, OIDC, SAML) marked with vendor extensions (`x-public-endpoint`, `x-authentication-required`, `x-public-endpoint-purpose`)
145145
- These endpoints are intentionally accessible without authentication per RFCs (8414, 7517, 6749, SAML 2.0)
@@ -210,10 +210,10 @@ TMI uses the Arazzo specification (OpenAPI Initiative) to document API workflow
210210

211211
**Files**:
212212

213-
- `docs/reference/apis/tmi.arazzo.yaml` - Generated Arazzo specification (YAML)
214-
- `docs/reference/apis/tmi.arazzo.json` - Generated Arazzo specification (JSON)
215-
- `docs/reference/apis/api-workflows.json` - TMI workflow knowledge base (source)
216-
- `docs/reference/apis/arazzo-generation.md` - Complete documentation
213+
- `api-schema/tmi.arazzo.yaml` - Generated Arazzo specification (YAML)
214+
- `api-schema/tmi.arazzo.json` - Generated Arazzo specification (JSON)
215+
- `api-schema/api-workflows.json` - TMI workflow knowledge base (source)
216+
- `api-schema/arazzo-generation.md` - Complete documentation
217217

218218
**Tools**:
219219

@@ -592,7 +592,7 @@ Key developer documentation:
592592
## User Preferences
593593

594594
- After changing any file, run `make lint` and fix any issues caused by the change
595-
- After changing the OpenAPI specification (`docs/reference/apis/tmi-openapi.json`):
595+
- After changing the OpenAPI specification (`api-schema/tmi-openapi.json`):
596596
1. Run `make validate-openapi` and fix any validation issues
597597
2. Run `make generate-api` to regenerate the API code
598598
3. Run `make lint` and fix any linting issues
@@ -676,7 +676,7 @@ When asked to commit changes:
676676
677677
### OpenAPI Integration
678678
679-
- API code generated from docs/reference/apis/tmi-openapi.json using oapi-codegen v2
679+
- API code generated from api-schema/tmi-openapi.json using oapi-codegen v2
680680
- Uses Gin web framework (not Echo) with oapi-codegen/gin-middleware for validation
681681
- OpenAPI validation middleware clears security schemes (auth handled by JWT middleware)
682682
- Generated types in api/api.go include Gin server handlers and embedded spec

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ clean-build:
208208

209209
generate-api:
210210
$(call log_info,"Generating API code from OpenAPI specification...")
211-
@oapi-codegen -config oapi-codegen-config.yml docs/reference/apis/tmi-openapi.json
211+
@oapi-codegen -config oapi-codegen-config.yml api-schema/tmi-openapi.json
212212
$(call log_success,"API code generated: api/api.go")
213213

214214

@@ -1352,13 +1352,13 @@ arazzo-scaffold: arazzo-install
13521352
arazzo-enhance:
13531353
$(call log_info,Enhancing with TMI workflow data...)
13541354
@uv run scripts/enhance-arazzo-with-workflows.py
1355-
$(call log_success,Enhanced Arazzo created at docs/reference/apis/tmi.arazzo.{yaml,json})
1355+
$(call log_success,Enhanced Arazzo created at api-schema/tmi.arazzo.{yaml,json})
13561356

13571357
validate-arazzo:
13581358
$(call log_info,Validating Arazzo specifications...)
13591359
@uv run scripts/validate-arazzo.py \
1360-
docs/reference/apis/tmi.arazzo.yaml \
1361-
docs/reference/apis/tmi.arazzo.json
1360+
api-schema/tmi.arazzo.yaml \
1361+
api-schema/tmi.arazzo.json
13621362
$(call log_success,Arazzo specifications are valid)
13631363

13641364
generate-arazzo: arazzo-scaffold arazzo-enhance validate-arazzo
@@ -1371,11 +1371,11 @@ arazzo-all: arazzo-install generate-arazzo
13711371
# OPENAPI/ASYNCAPI VALIDATION
13721372
# ============================================================================
13731373

1374-
OPENAPI_SPEC := docs/reference/apis/tmi-openapi.json
1375-
OPENAPI_VALIDATION_REPORT := docs/reference/apis/openapi-validation-report.json
1376-
OPENAPI_VALIDATION_DB := docs/reference/apis/openapi-validation.db
1377-
ASYNCAPI_SPEC := docs/reference/apis/tmi-asyncapi.yml
1378-
ASYNCAPI_VALIDATION_REPORT := docs/reference/apis/asyncapi-validation-report.json
1374+
OPENAPI_SPEC := api-schema/tmi-openapi.json
1375+
OPENAPI_VALIDATION_REPORT := test/outputs/api-validation/openapi-validation-report.json
1376+
OPENAPI_VALIDATION_DB := test/outputs/api-validation/openapi-validation.db
1377+
ASYNCAPI_SPEC := api-schema/tmi-asyncapi.yml
1378+
ASYNCAPI_VALIDATION_REPORT := test/outputs/api-validation/asyncapi-validation-report.json
13791379

13801380
validate-openapi:
13811381
$(call log_info,Validating OpenAPI specification...)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The complete development environment (server + database + Redis) will start auto
4343
- `api/` - API types and handlers
4444
- `cmd/server/` - Server entry point and configuration
4545
- `tmi-api-v1_0.md` - API documentation
46-
- `docs/reference/apis/tmi-openapi.json` - OpenAPI specification
46+
- `api-schema/tmi-openapi.json` - OpenAPI specification
4747

4848
## Architecture
4949

docs/reference/apis/arazzo/scaffolds/base-scaffold.arazzo.yaml renamed to api-schema/arazzo/scaffolds/base-scaffold.arazzo.yaml

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
},
190190
"api": {
191191
"version": "1.0.0",
192-
"specification": "https://github.com/ericfitz/tmi/blob/main/docs/reference/apis/tmi-openapi.json"
192+
"specification": "https://github.com/ericfitz/tmi/blob/main/api-schema/tmi-openapi.json"
193193
},
194194
"operator": {
195195
"name": "Example Organization",

0 commit comments

Comments
 (0)