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
{{ message }}
Repository navigation
[FEATURE] Introduce a mechanism for detecting and incorporating breaking changes from spec in a backward compatible way #1927
Today, the Java client can include breaking changes in each release, as it is generated from the latest spec updates and does not always take prior Java client versions into account. This can make backward compatibility and future evolution more difficult.
What solution would you like?
Java client should introduce some kind of versioning / compatibility matrix / backward compability support (e.g. marking old fields as deprecated but not fully removing them until the next OS major version release), to support correctness fixes coming from the upstream source of truth opensearch-api-specification.
As a general principle, downstream consumers (e.g. java client, opensearch-protobufs) should not block upstream (i.e. opensearch-api-specification) from being updated.
What alternatives have you considered?
Any solution that allows independent evolution and autonomy of the opensearch-api-specification will suffice.
It proposes that the spec build also publishes a resolved client model (opensearch-client-model.json) next to opensearch-openapi.yaml: every type with its $refs followed, its allOfs merged and its unions classified (fields with requiredness, bases for inheritance, version and deprecation metadata, union kinds with variant keys or tags, presence/container constraints). The prototype is opensearch-api-specification#1329.
Two points connect to this issue:
Detecting breaking changes: the model is a flat list of types, so diffing it between spec versions shows which fields of which types changed shape, which could feed the compatibility mechanism proposed here.
Classification in java-codegen: today java-codegen decides itself whether a union is a tagged union (OpenApiSchema.isTaggedUnionInner) and flattens allOfs (ObjectFlatteningVisitor); with the normalized spec it would turn TermsLookup into a tagged union. The model states the union kind (presence for TermsLookup, container with its variant keys for AggregationContainer) so that decision is made once in the spec.
Would this design work for opensearch-java? Feedback on the RFC is very welcome.
Activity
krisfreedain commentedon Mar 30, 2026
@reta @Bukhtawar @szczepanczykd maintainers - can you take a look?
Catch All Triage - 1 2 3
yyfamazon commentedon Nov 12, 2026
Related RFC: opensearch-project/opensearch-api-specification#1334
It proposes that the spec build also publishes a resolved client model (
opensearch-client-model.json) next toopensearch-openapi.yaml: every type with its$refs followed, itsallOfs merged and its unions classified (fields with requiredness,basesfor inheritance, version and deprecation metadata, union kinds with variant keys or tags, presence/container constraints). The prototype is opensearch-api-specification#1329.Two points connect to this issue:
OpenApiSchema.isTaggedUnionInner) and flattensallOfs (ObjectFlatteningVisitor); with the normalized spec it would turnTermsLookupinto a tagged union. The model states the union kind (presenceforTermsLookup,containerwith its variant keys forAggregationContainer) so that decision is made once in the spec.Would this design work for opensearch-java? Feedback on the RFC is very welcome.
cc @reta @Bukhtawar @szczepanczykd @madhusudhankonda @saratvemulapalli @Xtansia @VachaShah