eclipse-vertx / vertx-json-schema

Vert.x Json Schema
Other
78 stars 32 forks source link

JsonObjectSchema.resolve() does not resolve JsonArray #58

Closed dprincethg closed 2 years ago

dprincethg commented 2 years ago

Questions

The JsonObjectSchema.resolve() only resolves References inside Jsonbject.

However, JsonArray may also contains reference(s).

Like for example, "Parameters" Field in OpenAPI: https://spec.openapis.org/oas/latest.html#operation-object

"parameters":[{"$ref":"#/components/parameters-query/aQeueryKey"}]

Version

v 4.3.0

Context

Do you have a reproducer?

No

Steps to reproduce

  1. Create JsonSchema instance from JsonObject containning arrays of Refs
  2. Call jsonSchema.resolve();
  3. Refs inside Arrays are not resolved
  4. Extra

pmlopes commented 2 years ago

The PR above will address this issue, The PR is not complete yet. The final goal is to add support to resolve and validate from a repository using just a json pointer, no need to keep a distinction between start schema and lookup schemas when using a repository.

dprincethg commented 2 years ago

Nice , it seems more efficient to add schema(s) to the repository (directly or from full openAPI content). And then to get Validator from jsonPointer to (sub) schema.

pmlopes commented 2 years ago

Indeed, I think that is should add all schemas to a repository and later we can always perform a resolution or validation by json pointer reference

https://github.com/eclipse-vertx/vertx-json-schema/pull/60