Closed adamaltman closed 10 months ago
@adamaltman I see you've closed the corresponding issue in the redocly-cli repo. Is this still valid?
Yes, it is still valid.
is this still valid @adamaltman ?
works for me on the first path test/api
. it doesn't capture consecutive path variables though which should be considered here.
openapi: 3.1.0
info:
title: blah
version: 1.1.0
paths:
/test/api:
get:
parameters:
- name: jeremy
in: query
schema:
type: string
responses:
"200":
$ref: "#/components/responses/jeremy"
/test/{test-id}/{thing}:
get:
parameters:
- name: test-id
in: path
schema:
type: string
required: true
- name: thing
in: path
schema:
type: string
required: true
components:
schemas:
jeremy:
anyOf:
- type: object
additionalProperties: false
required:
- test
properties:
test:
type: string
- type: string
enum:
- test
- two
- three
responses:
jeremy:
description: "test response"
content:
application/json:
schema:
$ref: "#/components/schemas/jeremy"
examples:
example_response:
$ref: examples\example.json
rule:
rule/restful-paths:
subject:
type: Paths
assertions:
notPattern: '/[^{/}]+\/[^{/}]+/'
message: Two consecutive path segments don't have a variable
cli v1.0.2 windows 10
In the other issue you mentioned problem reporting. I see it doesn't report more than one error because there is only one instance of type Paths
, so it highlights only that instance. It probably needs to report on the location child or key rather than the subject.
Yeah, the reporting location is wrong for sure.
Thanks @jeremyfiel 🙏
Fixed in v0.3.1 via https://github.com/Redocly/redocly-cli/pull/1299.
What happened?
I added this configurable rule, as mentioned here: https://github.com/Redocly/redocly-cli/issues/1225
It does not report a problem, when running
lint
reports 22 problems.What should have happened instead?
I expect to see the 22 problems.
Minimal reproducible OpenAPI snippet
Contact me.
Screenshots n/a
Additional context
OAS 3.1, Redocly CLI 1.0.2.