-
Notifications
You must be signed in to change notification settings - Fork 0
Draft v1.1 #19
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
Draft
MichaelWDanko
wants to merge
27
commits into
main
Choose a base branch
from
draft-v1.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Draft v1.1 #19
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1d584d7
Merge pull request #18 from openmobilityfoundation/main
MichaelWDanko 350f837
Update README.md
MichaelWDanko e982398
Removes old file that isn't in use
MichaelWDanko 901f305
Adds proposed changelog file
MichaelWDanko 8e52a11
API version bump, README date, fix last_updated refs
MichaelWDanko 58e71a8
Changes to gitignore
MichaelWDanko 52418c2
Adds AGENTS/CLAUDE MD files for AI help
MichaelWDanko 94fbcdf
Adds CHANGELOG AND 1.1 implementation plan
MichaelWDanko dd466a3
feat(shared): add external_reference, custom_attributes, and LineStri…
MichaelWDanko 9bda37c
docs: restructure v1.1 implementation plan with wave-based parallel e…
MichaelWDanko 5761e0b
Changes last updated date
MichaelWDanko f8a7270
fix: correct event_type ref, vehicle_type typo, and days_of_week type
MichaelWDanko debd2f9
chore: tighten OpenAPI lint metadata and plan tracking
MichaelWDanko d3e1d78
chore: Adds emails to the YAML files to fix linting issues
MichaelWDanko 3c33487
fix: clean up pre-existing defects and linter issues
MichaelWDanko 5b1ff5c
fix(shared): align external_reference schema with v1.1 spec
MichaelWDanko b535c70
Revised AGENTS.MD file
MichaelWDanko a291737
Add instructions to update the plan after the steps are worked on
MichaelWDanko 2e03c8f
Marks step 1B completed
MichaelWDanko b00c7cc
feat(shared): add payment_channel, payment_method, enforcement, and v…
MichaelWDanko 7d7d227
feat(shared): add enforcement and detection event types
MichaelWDanko e576203
feat(shared): complete Wave 1 shared schema updates
MichaelWDanko 57f6171
docs: simplify and re-baseline v1.1 implementation plan
MichaelWDanko dd9c07d
feat(api): use custom_attributes_dictionary in JSON responses
MichaelWDanko 798d6de
feat: complete phase 2 shared model parity
MichaelWDanko 4ac0ef2
feat: implement phase 3 API parity
MichaelWDanko 3c3a04f
fix: align v1.1 OpenAPI schemas with CDS spec
MichaelWDanko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| archive/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # Working with the CDS OpenAPI Project | ||
|
|
||
| This document describes how to collaborate with an AI agent (or human contributor) on the `cds-openapi` project. | ||
|
|
||
| ## Project Purpose | ||
|
|
||
| This repository maintains an **OpenAPI 3.1 specification** for the [Curb Data Specification (CDS)](https://github.com/openmobilityfoundation/curb-data-specification), managed by the Open Mobility Foundation. The spec is hosted publicly via Stoplight and serves as an interactive API browser for implementers. | ||
|
|
||
| ## Repository Structure | ||
|
|
||
| ``` | ||
| cds-openapi/ | ||
| APIs/ | ||
| Curbs API.yaml # Curb zones, areas, spaces, policies, objects | ||
| Events API.yaml # Curb events and sensor status | ||
| Metrics API.yaml # Sessions and aggregates | ||
| Shared Data Models/ # Reusable YAML schemas (curb_zone, curb_event, etc.) | ||
| Rest Responses/ # Common API response header schemas | ||
| toc.json # Stoplight table of contents | ||
| .spectral.mjs # Linting rules | ||
| .stoplight.json # Stoplight platform config | ||
| V1.1_IMPLEMENTATION_PLAN.md # Active implementation plan | ||
| ``` | ||
|
|
||
| ## Branch Strategy | ||
|
|
||
| | Branch | Purpose | | ||
| |--------|---------| | ||
| | `main` | Stable, latest released version | | ||
| | `v1.0` | Frozen v1.0 spec | | ||
| | `draft-v1.1` | Active development branch for v1.1 changes | | ||
|
|
||
| Always work on the `draft-v1.1` branch (or a feature branch off it) when implementing v1.1 changes. Never push directly to `main`. | ||
|
|
||
| ## Upstream Spec Reference | ||
|
|
||
| The authoritative CDS spec lives at https://github.com/openmobilityfoundation/curb-data-specification. When implementing changes: | ||
|
|
||
| 1. Treat the upstream repository's `main` branch as the source of truth for the latest CDS specification | ||
| 2. Always cross-reference the upstream spec text, not just PR summaries | ||
| 3. Before editing local OpenAPI files, verify the relevant field names, types, enums, descriptions, and required/optional status against upstream `main` | ||
| 4. When a discrepancy is found, label it explicitly as local drift, upstream ambiguity, or an inference | ||
| 5. The spec has three sections: `curbs/`, `events/`, `metrics/` — each with its own README | ||
| 6. The `general-information.md` and `data-types.md` files contain shared definitions | ||
|
|
||
| ## How to Make Changes | ||
|
|
||
| ### Workflow for each step in the implementation plan | ||
|
|
||
| 1. **Read the plan step** in `V1.1_IMPLEMENTATION_PLAN.md` | ||
| 2. **Read the upstream spec on `main`** for the relevant section to confirm exact field names, types, enums, descriptions, and required/optional status | ||
| 3. **Edit the YAML files** — maintain the existing style conventions: | ||
| - Use `$ref` for shared models rather than inline definitions | ||
| - Include `description` on every field | ||
| - Use `x-stoplight: id:` annotations if present on surrounding fields (Stoplight generates these) | ||
| - Keep `required` arrays up to date | ||
| 4. **Validate** — run the Spectral linter (`.spectral.mjs`) after all changes for the task. `spectral` is currently available in this environment, so validation should be performed before wrapping up work. | ||
| 5. **Update the plan** — use strikethrough in `V1.1_IMPLEMENTATION_PLAN.md` to mark completed items as work lands. Do not add status suffixes like `DONE`, `TODO`, or `Partial` to implementation-step headings. | ||
| 6. **Commit** — use the commit message suggested in the plan step, or a similar conventional-commit style message | ||
|
|
||
| ### Style conventions | ||
|
|
||
| - File names: `snake_case.yaml` for shared models | ||
| - Enum values: `snake_case` | ||
| - UUID fields: `type: string, format: uuid` | ||
| - Timestamps: `$ref: ./timestamp.yaml` | ||
| - Geographic fields: `$ref` to `geoJSON_point.yaml`, `geoJSON_polygon.yaml`, or `geoJSON_linestring.yaml` | ||
| - Arrays of references: `type: array` with `items: { $ref: ./some_model.yaml }` | ||
|
|
||
| ### Adding a new shared model | ||
|
|
||
| 1. Create the YAML file in `Shared Data Models/` | ||
| 2. Add a `$ref` from any model or API that uses it | ||
| 3. Add an entry to `toc.json` under the appropriate section | ||
| 4. Verify the `$ref` path is correct relative to the referencing file | ||
|
|
||
| ## Validation | ||
|
|
||
| The project uses Spectral for OpenAPI linting: | ||
|
|
||
| ```bash | ||
| spectral lint "APIs/*.yaml" | ||
| ``` | ||
|
|
||
| The `.spectral.mjs` config extends a remote Stoplight ruleset. `spectral` is currently available in this workspace and should be run after all changes are made. Always lint and fix any errors before committing. When a task adds or edits standalone shared model files, lint those touched files as well in addition to the API documents. | ||
|
|
||
| ## Key Gotchas | ||
|
|
||
| - **$ref paths are relative** to the file containing the reference. API files use `../Shared Data Models/foo.yaml`; shared models use `./foo.yaml`. | ||
| - **Spaces in file names**: `Curbs API.yaml` has a space — use URL encoding (`Curbs%20API.yaml`) in Markdown links but literal paths in `$ref`. | ||
| - **toc.json** controls what appears in the Stoplight browser — new models won't show up until added here. | ||
| - **x-stoplight IDs** are auto-generated by the Stoplight editor. When adding fields by hand, you can omit them and Stoplight will generate them later, or include them for consistency. | ||
| - **501 responses** must be documented on all optional endpoints per the CDS spec pattern. | ||
|
|
||
| ## Implementation Plan | ||
|
|
||
| The active plan for v1.1 work is in `V1.1_IMPLEMENTATION_PLAN.md`. Follow the phases and steps in order — they are sequenced so that schema dependencies are in place before API paths reference them. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AGENTS.MD and CLAUDE.md files were added to support AI development of the open API spec.