You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm trying to validate an incoming payload against an OpenAPI document. The open api document is present in a particular path as a json file. I would like to use SchemaLocation with this file path, but I'm getting file not found exception. Can someone help me how to overcome this, or any other alternative way?
Given below is my code snippet,
SchemaRegistry schemaRegistry = SchemaRegistry.withDialect(Dialects.getOpenApi31(),
builder -> builder.schemaLoader(schemaLoader -> schemaLoader.allow(iri ->
iri.toString().startsWith("file:")))
.build());
Path path = Paths.get("/home/kiran/tmf666_v5.json");
final var location = SchemaLocation.of(path.toUri().toString());
Schema schema = schemaRegistry.getSchema(location);
The last statement schemaRegistry.getSchema gives rise to FileNotFoundException.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to validate an incoming payload against an OpenAPI document. The open api document is present in a particular path as a json file. I would like to use SchemaLocation with this file path, but I'm getting file not found exception. Can someone help me how to overcome this, or any other alternative way?
Given below is my code snippet,
SchemaRegistry schemaRegistry = SchemaRegistry.withDialect(Dialects.getOpenApi31(),
builder -> builder.schemaLoader(schemaLoader -> schemaLoader.allow(iri ->
iri.toString().startsWith("file:")))
.build());
The last statement schemaRegistry.getSchema gives rise to FileNotFoundException.
Beta Was this translation helpful? Give feedback.
All reactions