Browse Source

minor Swagger improvements

pull/15166/head
dashevchenko 7 months ago
parent
commit
4f37dace97
  1. 4
      application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java

4
application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java

@ -306,7 +306,7 @@ public class SwaggerConfiguration {
} }
} else if (schema != null && schema.getProperties() != null && !schema.getProperties().isEmpty()) { } else if (schema != null && schema.getProperties() != null && !schema.getProperties().isEmpty()) {
try { try {
var beanDesc = JacksonUtil.OBJECT_MAPPER.getSerializationConfig().introspect(javaType); var beanDesc = Json.mapper().getSerializationConfig().introspect(javaType);
var orderedNames = resolvePropertyOrder(cls, beanDesc); var orderedNames = resolvePropertyOrder(cls, beanDesc);
if (!orderedNames.isEmpty()) { if (!orderedNames.isEmpty()) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -320,7 +320,7 @@ public class SwaggerConfiguration {
schema.setProperties(reordered); schema.setProperties(reordered);
} }
} catch (Exception ignored) { } catch (Exception ignored) {
// keep original order if introspection fails log.trace("Failed to resolve property order for {}", cls.getName(), ignored);
} }
} }
} }

Loading…
Cancel
Save