Alphabetical and '@key'
See original GitHub issueDescribe 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:
response-order:
message: Responses should be in alphabetical order
recommended: true
given: $.paths.*.*
then:
field: responses
function: alphabetical
functionOptions:
keyedBy: '@key'
I’ve also tried this form:
response-order:
message: Responses should be in alphabetical order
recommended: true
given: $.paths.*.*.responses
then:
field: '@key'
function: alphabetical
To Reproduce
Given this OpenAPI document
openapi: 3.0.2
info:
title: Test Spec
version: 0.0.0
paths:
/foo:
get:
operationId: get-foo
responses:
'400':
description: ''
'200':
description: ''
Run this CLI command
spectral lint test-spec.yaml -r my-rules.yaml
Expected behavior
The lint output should contain the following:
9:17 warning response-order Responses should be in alphabetical order
Environment
- Library version: 4.2.0
- OS: Windows 10
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Alphabetic Keys | Shortcut Matters - WordPress.com
Alphabetic Keys : These are keys that have alphabets on them, ranging from A to Z. Punctuation Keys: These are keys of the...
Read more >Alphabet Key Letter Vector Images (over 4,100) - VectorStock
The best selection of Royalty Free Alphabet Key Letter Vector Art, Graphics and Stock Illustrations. Download 4100+ Royalty Free Alphabet Key Letter Vector ......
Read more >How many Alphabet Keys in Keyboard? - BYJU'S Exam Prep
The keyboard has 26 alphabets keys which are used to type sentences or words on a computer system in both capital and small...
Read more >Keyboard with alphabetical key organization and method of use
A keyboard adaptable for any type of a computer or other electronic device uses an alphabetical lettering arrangement that id divided into ...
Read more >Sort dictionary alphabetically when the key is a string (name)
simple algorithm to sort dictonary keys in alphabetical order, First sort the keys using sorted sortednames=sorted(dictUsers.keys(), ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dillonredding soon! hopefully next week or in 2 weeks 😃 Def before the end of year.
@dillonredding Just wanted to give you heads up that this particular issue is going to be resolved in the next release.