[Feature Request] HTTP: declare custom/extended HTTP methods and emit OpenAPI 3.2 additionalOperations
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- openapi
- Ambito
- api, backend-api-design
Direzione di ricerca
Inizia dal modello HttpVerb e HttpOperation di @typespec/http, quindi segui OpenAPIPathItem3_2 di @typespec/openapi3 e l’emissione degli elementi path. Verifica come vengono selezionate le versioni di destinazione e come vengono segnalate le diagnosi. Il lavoro è completato quando i metodi personalizzati possono essere dichiarati, sono esposti agli emitter, vengono emessi come additionalOperations per OpenAPI 3.2 e viene generata una diagnosi per le destinazioni non supportate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Clear and concise description of the problem
OpenAPI 3.2 added the additionalOperations field on the Path Item Object, so a document can now describe operations using HTTP methods outside the classic eight (WebDAV's PROPFIND/PROPPATCH/MKCOL/MOVE/COPY/LOCK, LINK/UNLINK, vendor methods, etc.), alongside the new first-class query method (#11171 tracks QUERY specifically).
TypeSpec currently cannot express such operations at all:
@typespec/http'sHttpVerbis the closed union"get" | "put" | "post" | "patch" | "delete" | "head", and there is no decorator to declare any other method.@typespec/openapi3(1.15.0) already ships the 3.2 output types —OpenAPIPathItem3_2includesadditionalOperations?: Record<string, OpenAPIOperation3_2>— but no code path ever writes it, since the language cannot produce such an operation.
So an API that serves, say, a WebDAV surface next to its REST surface can bring the REST half under TypeSpec but must leave the WebDAV half entirely outside the contract, even when targeting openapi-versions: [3.2.0] where the document format can now say it.
Describe the solution you'd like
A way to declare an operation with an arbitrary (registered or vendor) HTTP method, for example:
@method("PROPFIND")
@route("/dav/{path}")
op propfind(@path path: string, @header depth?: string): MultiStatusResponse;
with:
- the method carried on
HttpOperationso third-party emitters can read it (we maintain server emitters built on@typespec/httpand would route these to the framework's custom-method registration), @typespec/openapi3emitting it underadditionalOperationswhen the target version is3.2.0, and a clear diagnostic (rather than silent omission) when targeting 3.0/3.1 where the field does not exist,querypresumably staying first-class per #11171, with this mechanism covering the long tail.
The exact surface (a @method decorator vs widening @route/op declarations) is your call — the ask is that the fact be declarable and emitted.
Describe alternatives you've considered
- Keeping the non-standard-method surface hand-written outside the spec (what we do today) — works, but splits one service's contract across two sources of truth.
- Post-processing the emitted document to inject
additionalOperations— rejected; it re-creates exactly the document/server divergence spec-first exists to remove.
Happy to contribute the implementation if the design direction is agreed.
- Lingua principale
- Java
- Stelle
- 5.9k
- Fork
- 421
- Merge medio
- 2g 3h
- PR unite (30g)
- 176
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la 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 microsoft/typespec
-
bug emitter:client:csharp
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoft/typespec#12572 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Make website build cross-platform compatibleForse già presa @pcbeingused333 l’ha presa oggi. Apertabug meta:website
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/typespec#12550 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Emitter framework: make the language-specific Alloy peer dependencies optionalForse già presa @timotheeguerin l’ha presa 8 giorni fa. Apertaemitter-framework feature triaged:core
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
microsoft/typespec#12476 · 1 commento · 2 reazioni · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
Upgrade C# generator Roslyn to 5.9.0Forse già presa @ArthurMa1978 l’ha presa 7 giorni fa. Apertaemitter:client:csharp feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/typespec#12445 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug emitter:client:python
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/typespec#12360 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/typespec
Issue simili
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationForse già presa @amalsaidov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
needs-area-label
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
area/ai area/backend component/zeebe kind/task
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spAnser/reacharound#38 ·