[hotfix][docs] Fix OpenAPI spec for SlotSharingGroupId, MetricCollectionResponseBody, and SerializedThrowable custom serializers#27903
Open
nikhilsu wants to merge 5 commits intoapache:masterfrom
Conversation
Collaborator
Author
nikhilsu
commented
Apr 8, 2026
Author
There was a problem hiding this comment.
FYI: changes to *.yml were made as part of running ./mvnw package -Dgenerate-rest-docs -pl flink-docs -am -nsu -DskipTests 2>&1
a89e2bd to
6b7ff1e
Compare
SlotSharingGroupId, MetricCollectionResponseBody, and SerializedThrowable custom serializers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This PR fixes three Flink request/response DTOs that use custom Jackson serializers, while their OpenAPI specs are generated from the DTO schema. This leads to a mismatch between the actual wire format and what the generated spec describes and breaking downstream clients:
SlotSharingGroupId: Serialized as a hex string bySlotSharingGroupIDSerializer(added in FLINK-20090), but the spec incorrectly defines it as an object withbytes,lowerPart,upperPartfields becauseoverrideIdSchemas()does not includeSlotSharingGroupId.MetricCollectionResponseBody: Serialized as a raw JSON array[{"id": "metricName", "value": "1"}]by a customSerializer(annotated with@JsonSerialize), but the spec incorrectly defines it as an object with ametricsproperty.SerializedThrowable: Serialized with three fields (class,stack-trace,serialized-throwable) by SerializedThrowableSerializer, but the spec override only includedserialized-throwable, omitting theclassandstack-trace` string fields.None of these changes break backward compatibility - the previous schemas never matched the actual wire format, so any client generated from the spec would have already failed to decode these fields correctly.
Affected endpoints:
GET /jobs/:jobid(SlotSharingGroupIdinJobDetailsInfo.JobVertexDetailsInfo)GET /jobmanager/metricsGET /jobs/:jobid/metricsGET /jobs/:jobid/vertices/:vertexid/metricsGET /jobs/:jobid/vertices/:vertexid/subtasks/metricsGET /jobs/:jobid/vertices/:vertexid/watermarksGET /taskmanagers/:taskmanagerid/metricsGET /taskmanagers/metricsSerializedThrowable(savepoint/checkpoint failure responses)Brief change log
SlotSharingGroupIdtoOpenApiSpecGenerator.overrideIdSchemas()to generatetype: stringwith pattern[0-9a-f]{32}overrideMetricCollectionSchema()to replace theMetricCollectionResponseBodyobject schema with an array schema referencingMetricoverrideSerializeThrowableSchema()to includeclassandstack-tracestring fields alongside the existingserialized-throwablebinary fieldFIELD_NAME_CLASSandFIELD_NAME_STACK_TRACEinSerializedThrowableSerializerpublic so they can be referenced fromOpenApiSpecGeneratorVerifying this change
This change is already covered by existing tests, such as
OpenApiSpecGeneratorTest.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation