rkhachatryan commented on code in PR #22139:
URL: https://github.com/apache/flink/pull/22139#discussion_r1131335767
##########
flink-docs/src/main/java/org/apache/flink/docs/rest/OpenApiSpecGenerator.java:
##########
@@ -452,7 +447,26 @@ private static Content createContentWithMediaType(String
mediaType, Schema schem
}
private static Schema<?> getSchema(Type type) {
- return modelConverterContext.resolve(new
AnnotatedType(type).resolveAsRef(true));
+ final AnnotatedType annotatedType = new
AnnotatedType(type).resolveAsRef(true);
+ final Schema<?> schema = modelConverterContext.resolve(annotatedType);
+ if (type instanceof Class<?>) {
+ final Class<?> clazz = (Class<?>) type;
+ ApiGeneratorUtils.findAdditionalFieldType(clazz)
+ .map(OpenApiSpecGenerator::getSchema)
+ .ifPresent(
+ additionalPropertiesSchema -> {
+ // We can not reuse the schema instance
returned by the converter
+ // above, because it's a different instance
than the resolver has
+ // defined, so we wouldn't see the changes
later when populating
+ // OpenAPI components.
+ final Schema<?> definedModel =
Review Comment:
Thanks for clarifying and updating the comment, it makes it much easier to
understand now!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]