Skip to content

Swagger 2.2.44 breaks definition of defaultValue in Schema annotation #573

@JoergSiebahn

Description

@JoergSiebahn

Hi,

Swagger introduced a placeholder for the default value in 2.2.44.

That results in the weird default value ##default in the generated schema for all properties that don't have the value defined in the annotation.

Currently, the Swagger2Module checks for empty. This is fine until 2.2.43.

I'm happy to provide a PR. But I would like to clarify the best way to deal with such changes in a dependency which is defined as provided first.
I see two options:

  1. Check for empty or "##default". The easiest, but would not result in a desired empty String with 2.2.44.
  2. Use reflection to find Schema#DEFAULT_SENTINEL. If it exists, use the value to compare, if not check for empty. This would respect both versions, but reflection may break on its own. Additionally, I have no idea, how this can be tested.

Do you have a preference or see a third option, @CarstenWickner?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions