Skip to content

Expansion of properties doesn't seem to work for numeric fields #532

@rdesgroppes

Description

@rdesgroppes

Expansion of properties doesn't seem to work for schema examples set on numeric fields.

Steps to Reproduce

  1. Have a project with a custom openapi.properties file (as per https://micronaut-projects.github.io/micronaut-openapi/latest/guide/index.html#propertiesFileConfiguration)
  2. Add a property micronaut.openapi.expand.example.version=42 to it
  3. Get the property expanded in the example of a String field and in the example of a long one:
    @Schema(example = "${example.version}")
    public String getVersionString() {
      return "foo";
    }
    @Schema(example = "${example.version}")
    public long getVersionLong() {
      return 0;
    }
  4. generate the OpenAPI spec

Expected Behaviour

The property gets expanded (to 42) in both cases.

Actual Behaviour

The example gets only expanded for the String field, and turns out to be stripped out for the long field.

Environment Information

micronaut 2.5.8 (micronaut-openapi 2.4.0).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions