commercetools / commercetools/commercetools-api-reference
Add body for default ResourceNotFound error
- Vorherrschende Sprache
- RAML
- Sterne
- 66
- Forks
- 33
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Currently in `api-specs/api/traits/errorable.raml` the 404 response is missing a body description. During code generation this causes the [Go code generator](https://github.com/commercetools/rmf-codegen/blob/main/languages/go/src/main/kotlin/io/vrap/codegen/languages/go/client/MethodRenderer.kt#L309) to skip generating a typed error for a ResourceNotFound response, defaulting to a GenericRequestError instead. I believe this happens because the 404 error gets filtered from the possible responses before being passed to the code generation method.
Would it be possible to add this body to the RAML definitions? Or do you maybe have other suggestions on how to deal with this type of missing body in described responses? I have tried hardcoding a 404 response in the code generation, but this conflicts with potential other raml definitions where there is a fully described 404.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne in api-specs/api/traits/errorable.raml und untersuche die standardmäßige 404-ResourceNotFound-Antwort zusammen mit allen vollständig beschriebenen 404-Antworten. Füge die fehlende Body-Definition hinzu und überprüfe anschließend, dass der Go-Codegenerator ResourceNotFound nicht mehr als GenericRequestError behandelt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- go
- Bereich
- api
- Issue-Typ
- Feature
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100