-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alphabetical and '@key' #730
Comments
@dillonredding |
@P0lip |
@dillonredding |
@P0lip |
@dillonredding soon! hopefully next week or in 2 weeks :) Def before the end of year. |
I noticed an issue with getting the To ReproduceUsing the rules taken directly from this test scenario and a modified version of the OpenAPI document in the same test we are not seeing the failed rule as we should. my-rules.yaml: rules:
response-order:
message: Responses should be in alphabetical order
recommended: true
given: $.paths.*.*.responses
then:
function: alphabetical test-spec.yaml: openapi: 3.0.2
info:
title: Test Spec
version: 0.0.0
paths:
/foo:
get:
operationId: get-foo
responses:
'404':
description: ''
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/foo'
components:
schemas:
foo:
title: More incorrect casing
type: object
properties:
id:
type: integer
bar:
type: string CLI command: spectral lint test-spec.yaml -r my-rules.yaml We should see the following in our results: 19:15 warning response-order Responses should be in alphabetical order Environment
|
@P0lip does this look like it maybe should be a new issue, or am I missing something with the |
@raworre it's somewhat related, but a bit different. Could you please file a new issue? |
Describe the bug
I may be doing it wrong, but the
alphabetical
function doesn't appear to work with'@key'
. Here's the rule I'm trying to create:I've also tried this form:
To Reproduce
Given this OpenAPI document
Run this CLI command
spectral lint test-spec.yaml -r my-rules.yaml
Expected behavior
The lint output should contain the following:
Environment
The text was updated successfully, but these errors were encountered: