I have defined schema in following structure.
├── schema
├── com
├── wf
├── test
├── schema_a.yaml
├── schema_b.yaml
schema_a.yaml:
openapi: 3.0.0
info:
title: SCHEMA A
version: 1.0.2
description: Links
x-package: com.workfusion.test
components:
schemas:
TypeFromB:
$ref: 'schema/com/wf/test/schema_b.yaml#/components/schemas/MyType'
UnrelatedType:
type: object
schema_b.yaml:
openapi: 3.0.0
info:
title: SCHEMA B
version: 1.0.2
description: Links
x-package: com.workfusion.test
components:
schemas:
MyType:
type: string
and I want to parse the below schema:
openapi: 3.0.0
info:
title: REF SCHEMA A
version: 1.0.1
components:
schemas:
in:
type: object
properties:
schema_a_ref:
$ref: 'schema/com/wf/test/schema_a.yaml#/components/schemas/TypeFromB'
parsing using
OpenAPIV3Parser parser = new OpenAPIV3Parser();
ParseOptions options = new ParseOptions();
options.setResolve(true);
return parser.readContents(yamlSchema, null, options, schemaDir.toAbsolutePath().toString());
and I got below error:
Unable to load RELATIVE ref: schema\com\wf\test\schema\com\wf\test\schema_b.yaml
I have defined schema in following structure.
schema_a.yaml:
schema_b.yaml:
and I want to parse the below schema:
parsing using
and I got below error:
Unable to load RELATIVE ref: schema\com\wf\test\schema\com\wf\test\schema_b.yaml