Skip to content
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

Examples in the referenced paths are parsed differently than those in non-referenced paths. #2111

Open
StarKhan6368 opened this issue Jul 23, 2024 · 0 comments

Comments

@StarKhan6368
Copy link

Hello,

When using OpenAPI Specification where the operations of an endpoint are being referenced using another file, the examples are parsed as strings rather than objects in the absence of a reference.

schema_diff

As observed in the image above, the only distinction is that the operations under /products are referenced in V1, whereas no such reference exists in V2. When flattened out both V1 and V2 are identical. However, the example value and example type do not match when these specifications are parsed.

Expected Behavior

The examples in both V1 and V2 should be parsed consistently as JSON Object.

Actual Behavior

In V1, where the operations are referenced:

V1 Example Value: {id=1, name=XYZ Product, inventory=100}
V1 Example Value Type: class java.util.LinkedHashMap

In V2, where no reference exists:

V2 Example Value: {"id":"1","name":"XYZ Product","inventory":100}
V2 Example Value Type: class com.fasterxml.jackson.databind.node.ObjectNode

Sample Project

I have created a sample repository demonstrating this issue with the failing tests, which can be accessed here, Thank you for your attention to this matter.

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

No branches or pull requests

1 participant