-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Property rules skipped for $ref'd properties #2091
Comments
I suppose the rule itself is not skipped, but the error itself is attached to a different file and therefore it's not exposed in the Diagnostics pane in Studio. |
Stoplight Studio. Specifically in the Code view. |
I also hit an issue similar to this. But looks like now error reporting for |
hmm, I'm still not sure if it is a bug or not but... {
"$id": "/schemas/test",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Test schema",
"info": {
"name": "TestSchema",
"title": "Test Schema",
"version": "2-0-0",
"format": "jsonschema"
},
"properties": {
"aaa": {
"title": "aaa",
"description": "The type",
"type": "string"
},
"bbb": {
"$ref": "./ref.schema.json"
}
},
"required": ["type", "ref"]
} {
"$id": "/schemas/ref",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Description",
"title": "Ref",
"info": {
"name": "Ref",
"title": "Title",
"format": "jsonschema"
},
"properties": {
"ccc": {
"title": "Ccc",
"description": "The version of the event",
"exampleValues": ["1-0-1"],
"type": "string",
"metadata": {
"personalData": false
}
}
},
"required": ["version"]
} So if we try to figure out how the refs are getting expanded I guess it will be something like that (omitted all the data that is not needed)
so when you try to apply JsonPath like in the Op's example
Why not "ccc"? Because this JsonPath will match only top level properties, not the nested inside "bbb". (you can check it in online JsonPath editor) To fix this issue you need to use recursive operator Hope that helps to somebody who bump their head at this :) |
Describe the bug
Some of my casing rules don't apply to property names if the property is a $ref: This is occurring within Stoplight Studio but it seems to be a spectral issue.
To Reproduce
Expected behavior
Both aircraftTail and aircraft should be tagged with a warning for not being PascalCased, however only aircraft is tagged. Any property that is a $ref, the property name isn't rule checked.
Screenshots
Environment (remove any that are not applicable):
Additional context
This problem is reproducible in individual models as well as within the main document rules.
The text was updated successfully, but these errors were encountered: