may i use custom $ref in yaml files

Hi, i have some json-schema.

 

Example:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "my_app_user",
"title": "User",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer"
}
},
"required": [
"name",
"age"
]
}

This schema leaves on private bitbucket project

 

In PHPStorm i create file, example user.yaml with next code:

$schema: "http://json-schema.org/draft-07/schema#"
$ref: "https://bitbucket.org/exampleuser/my-repo/raw/main/schemas/user-schema.json"

name: max
age: 12

Expected result: after I specify `$ref`, - the document would validate by schema(as same as I do it by specifying file manually)

Actual result: no validation

 

does PHPStorm(or other your product) provide my expected behavior?

0

From what I know, the validation with the schema from $ref will not work in PhpStorm and you have to add specify schemas manually.

Just a random thought but probably, one of these plugins may help?
https://plugins.jetbrains.com/plugin/14837-openapi-swagger-editor
https://plugins.jetbrains.com/plugin/8347-swagger

0

请先登录再写评论。