JsonSchemasEndpoint class

The jsonschemas endpoint: the JSON Schemas of the application.

  • registry: the schemas of the context's JsonSchemaRegistry (those of spring.json.schemas, of @JsonSchemaSource, of JsonSchema beans and of the app's own customizers), by the location or $id each is known by;
  • introspected: the schema of every @Introspected class of the application, made from its introspection with the ObjectMapper's naming (JsonSchemaGenerator): what its JSON looks like.

GET /actuator/jsonschemas/{name} gives one: a class name, else a location (/actuator/jsonschemas/resources:schemas/order.json); nothing (404) when there is none. Like every endpoint but health, it answers over HTTP once exposed: management.endpoints.web.exposure.include=health,jsonschemas.

{"registry": {"resources:schemas/order.json": {"type": "object", ...}},
 "introspected": {"Book": {"$schema": "...", "title": "Book", ...}}}

Spring has no counterpart.

Annotations

Constructors

JsonSchemasEndpoint({JsonSchemaRegistry? registry, JsonSchemaGenerator? generator})
The endpoint of registry (none: an empty registry) and of the classes generator knows.

Properties

generator → JsonSchemaGenerator
Makes the schemas of the @Introspected classes.
final
hashCode → int
The hash code for this object.
no setterinherited
registry → JsonSchemaRegistry?
The context's registry; null when it has none.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
schema(List<String> path) → Map<String, Object?>?
The schema named by path: a class name, else a location of the registry (its segments joined by /); null when there is none.
schemas() → Map<String, Object?>
Every schema: those of the registry and those of the classes.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited