Support OpenAPI specification as a declarative config source
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia da docs/adc-test-parity-plan.md e dal a7 config command e dal flusso di validazione esistenti. Studia adc/libs/converter-openapi/, i suoi fixture basic-1..7 e extension-1..12, oltre a basic.spec.ts e extension.spec.ts; il lavoro è completo quando include la conversione YAML/JSON di OpenAPI 3.x, una copertura equivalente, una validazione riuscita e la documentazione in docs/.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Add an a7 config convert (or similar) command that takes an OpenAPI 3.x specification and produces an a7 declarative configuration file. The adc CLI has the equivalent feature today.
Motivation
Teams that already maintain OpenAPI specs as the source of truth for their HTTP APIs currently have to write a parallel a7 config by hand. Letting them generate a starter config from the OpenAPI doc:
- removes the manual translation step,
- keeps gateway config in sync with the service contract,
- matches what users coming from `adc` already expect.
adc reference
- Library: `adc/libs/converter-openapi/`
- Tests / fixtures: `adc/libs/converter-openapi/test/assets/basic-1.yaml` through `basic-7.yaml` (basic conversion) and `extension-1.yaml` through `extension-12.yaml` (custom `x-*` extension handling)
- Test specs: `adc/libs/converter-openapi/test/basic.spec.ts`, `extension.spec.ts`
Scope sketch
Mapping rules (from adc):
| OpenAPI element | a7 resource |
|---|---|
| `servers` | service with inline upstream (host/port from URL) |
| `paths` + method | route (URI from path, method in `methods`) |
| Path operation `x-adc-route` extensions | route-level overrides (name, plugins, labels) |
| Top-level `x-adc-service` | service-level overrides |
| Component `x-adc-plugins` | plugin attachments |
CLI surface (proposal — open to discussion):
```
a7 config convert --from-openapi spec.yaml -o config.yaml
```
Or as a subcommand of `config`: `a7 config convert openapi spec.yaml`.
Design considerations
- Schema library — Go ecosystem has `getkin/kin-openapi` (most common) and `pb33f/libopenapi`. Pick one that handles 3.0 + 3.1.
- Extension namespace — adc uses `x-adc-`. We could keep that, switch to `x-a7-`, or accept both for compatibility with adc-generated specs.
- Round-trip — is the inverse (`a7 config → OpenAPI`) in scope? adc does not do this; would suggest deferring.
- Validation chain — converted config should round-trip through `a7 config validate` cleanly.
Why deferred
Identified as a parity gap during the adc → a7 test parity audit (see `docs/adc-test-parity-plan.md`). Scope is too large to bundle with the other parity work — needs a dedicated package with its own fixture-driven test suite (the adc equivalent has ~19 fixture files).
Definition of done
- `a7 config convert` (or chosen surface) accepts OpenAPI 3.x YAML/JSON.
- Output passes `a7 config validate`.
- Test coverage equivalent to adc's basic-1..7 + extension-1..12 cases.
- Documented in `docs/`.
- Lingua principale
- Go
- Stelle
- 1
- Fork
- 0
- Merge medio
- 1h 3m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di api7/a7
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
config validate: detect bare/null unsupported sections (true key-presence)Forse di nuovo libera @shreemaan-abhishek l’ha presa 147 giorni fa e non c’è nessuna pull request aperta. Aperta
Issue simili
-
📖 docs: Docker Compose quick start doesn't mention editing the project values in src/hive.yamlApertadocumentation help wanted needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
hivecommons/hive#11606 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[docs] `/docs/identity-security/usage/alerts/`: docs reference a date that has already passedApertadocumentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
gravitational/teleport#69869 ·
-
category:agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
LanternOps/breeze#8493 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
shaiknoorullah/hg-mono#815 ·
I maintainer di solito rispondono entro 1 giorno