fix: simplify YAML anchor pattern in devproxy-errors.yaml#1569
fix: simplify YAML anchor pattern in devproxy-errors.yaml#1569garrytrinder merged 1 commit intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies the YAML anchor pattern in DevProxy/devproxy-errors.yaml by removing the unnecessary definitions: wrapper object and promoting the YAML anchors (client_error_body, server_error_body) directly to top-level keys. This makes the file more idiomatic YAML — anchors are a native YAML language feature and do not need a JSON Schema/OpenAPI-style container. The v2.2.0 genericrandomerrorplugin.errorsfile.schema.json already has "additionalProperties": true at the root level, so the promoted keys are fully schema-compliant.
Changes:
- Removes the
definitions:wrapper object fromdevproxy-errors.yaml - Promotes
client_error_bodyandserver_error_bodyanchor definitions to top-level keys (reducing one level of indentation for each)
garrytrinder
left a comment
There was a problem hiding this comment.
Built and tested in detached mode with a config pointing to the YAML errors file. 1 error responses loaded from devproxy-errors.yaml — simplified top-level anchors work correctly. Schema has additionalProperties: true so the extra top-level keys are fine. LGTM.
Remove the unnecessary `definitions` wrapper and promote YAML anchors to top-level keys. This is more idiomatic anchors are a nativeYAML language feature and don't need a JSON Schema/OpenAPI-style container. Closes dotnet#1568 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
763cac2 to
ecbe88a
Compare
Summary
Removes the unnecessary
definitions:wrapper fromdevproxy-errors.yamland promotes YAML anchors to top-level keys.YAML anchors are a native language feature and don't need a JSON Schema/OpenAPI-style container. The schema already allows arbitrary top-level keys, so no schema changes are needed.
Before
After
Closes #1568