Skip to content

Conversation

@bhufmann
Copy link
Contributor

What it does

Specify list possible implementation of AxisDomain in the swagger annotations. The AxisDomain can be either categorical or numeric range.

How to test

Generate the openapi.yaml as described here and verify that the oneOf list is present.

Follow-ups

Review checklist

  • As an author, I have thoroughly tested my changes and carefully followed the instructions in this template

Copy link
Contributor

@PatrickTasse PatrickTasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I check the

* serialization via {@code type} discriminator.
*/
@Schema(description = "Domain of values supported on a chart axis. Can be either categorical or numeric range.")
@Schema(description = "Domain of values supported on a chart axis. Can be either categorical or numeric range.", oneOf = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I check the corresponding yaml, it looks like an infinite recursion of AxisDomain to oneOf.
Maybe we need that the XYAxisDescription refers to oneOf instead.

Also the example value is generic with "type" value "string", not one of the two possible values, but I'm not sure if that can be fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I think it's not correct like that. I think, instead, I have to change the XYAxisDescription as below:

    /**
     * @return Optional domain of values that this axis can take.
     */
    @JsonProperty("axisDomain")
    @Schema(description = "Optional domain of values that this axis supports", requiredMode = RequiredMode.NOT_REQUIRED, oneOf = {
            AxisDomainCategorical.class,
            AxisDomainRange.class
    })
    @Nullable Object getAxisDomain();

@bhufmann bhufmann force-pushed the fix_axis_domain_swagger branch from 084d55c to 40d66fb Compare August 27, 2025 14:44
The AxisDomain can be either categorical or numeric range.

Signed-off-by: Bernd Hufmann <[email protected]>
@bhufmann bhufmann force-pushed the fix_axis_domain_swagger branch from 40d66fb to bef70c9 Compare August 27, 2025 15:26
@bhufmann bhufmann merged commit cd12f49 into eclipse-tracecompass-incubator:master Aug 27, 2025
2 checks passed
@bhufmann bhufmann deleted the fix_axis_domain_swagger branch August 27, 2025 17:07
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.

2 participants