Skip to content

Instantly share code, notes, and snippets.

@kevinswiber
Created October 13, 2023 05:01
Show Gist options
  • Save kevinswiber/19d4215b19dfd6096fcf2cea13a0ff16 to your computer and use it in GitHub Desktop.
Save kevinswiber/19d4215b19dfd6096fcf2cea13a0ff16 to your computer and use it in GitHub Desktop.
Spectral de-dupe minimal repro
rules:
missing_error_response_content:
given: '$..responses[?(@property && @property.match(/^(4|5)/))]'
then:
field: content
function: defined
formats:
- oas3
severity: warn
message: Error response should contain a response body.
openapi: 3.1.0
info:
title: De-duplicated Spectral results example
version: 0.1.0
paths:
/test:
get:
responses:
"400":
$ref: "#/components/responses/default"
"500":
$ref: "#/components/responses/default"
components:
responses:
default:
description: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment