Skip to content

refactor(core): Use ObjectMapperFactory to create ObjectMapper instead of new instance #2983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ahoo-Wang
Copy link

@Ahoo-Wang Ahoo-Wang commented May 7, 2025

  • Use ObjectMapperFactory to create ObjectMapper instead of new instance (Prevent additionalProperties deserialization exception)
  • Check OpenAPI specification version and use appropriate ObjectMapper
  • This change ensures proper deserialization for both 3.0 and 3.1 specifications
2025-05-07T15:09:27.656+08:00  WARN 43847 --- [x-service] [r-http-kqueue-3] o.springdoc.core.service.OpenAPIService  : Json Processing Exception occurred: additionalProperties must be either a Boolean or a Schema instance
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1228667] (through reference chain: io.swagger.v3.oas.models.OpenAPI["components"]->io.swagger.v3.oas.models.Components["schemas"]->java.util.LinkedHashMap["prajna.StringStringMap"]->io.swagger.v3.oas.models.media.Schema["additionalProperties"])

…d of new instance

- Use ObjectMapperFactory to create ObjectMapper instead of new instance (Prevent `additionalProperties` deserialization exception)
- Check OpenAPI specification version and use appropriate ObjectMapper
- This change ensures proper deserialization for both 3.0 and 3.1 specifications

Signed-off-by: Ahoo Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant