Skip to content
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

W-11680259: avoid throwing remote context error in canParse method #1730

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#%RAML 1.0
title: API body demo
version: v1
baseUri: http://api.domain.com/

types:
JsonSchema:
type: !include person.json
example: !include person-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"@context": "nowhere.json",
"name": "John Smith",
"birthday": "1990-10-12",
"gender": "male",
"url": "https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s",
"image": {
"url": "https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s/image",
"thumb": "https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s/image/thumb"
},
"tagline": "Hi, I'm John!",
"language": "en_US"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"birthday": {
"type": "string"
},
"gender": {
"type": "string"
},
"url": {
"type": "string"
},
"image": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"thumb": {
"type": "string"
}
},
"required": [
"url",
"thumb"
]
},
"tagline": {
"type": "string"
},
"language": {
"type": "string"
}
},
"required": [
"name",
"birthday",
"gender",
"url",
"image",
"tagline",
"language"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -723,4 +723,9 @@ class RamlModelUniquePlatformReportTest extends UniquePlatformReportGenTest {
test("Standalone array as type") {
validate("/raml/standalone-array-as-type.raml", Some("raml/standalone-array-as-type.report"))
}

// W-11680259
test("a json example with @context that points to nowhere should not throw an error") {
validate("/raml/raml-with-json-schema/api.raml")
}
}