We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Any URL (object) in the request body is translated to
{ "protocol": "string", "host": "string", "port": 0, "file": "string", "authority": "string", "ref": "string", "hashCode": 0, "defaultPort": 0, "content": "string", "serializedHashCode": 0 }
In the SwaggerUI. The generated example does not actually work since the request expects a string (e.g. "https://example.com)
URLs in the request body should be converted to strings.
URLs in the request body are converted to a dump of the URL object itself.
Reproducer, use REST + REST Jackson + OpenAPI extensions:
@Path("/hello") class ExampleResource { /** * This produces in invalid schema example for the request body: * * { * "protocol": "string", * "host": "string", * "port": 0, * "file": "string", * "authority": "string", * "ref": "string", * "hashCode": 0, * "defaultPort": 0, * "content": "string", * "serializedHashCode": 0 * } * * The response will be 400 Bad Request. * * When manually specifying the following request body: * * "https://example.com" * * The response will be 200 OK "Received URL: https://example.com". */ @POST @Path("/url-invalid-schema") fun postUrlInvalidSchemaExample(url: URL) = "Received URL: $url" }
uname -a
ver
Ubuntu
java -version
Java 21
3.12.3
mvnw --version
gradlew --version
Gradle 8.8
Perhaps we need a TYPE_MAP.put(DotName.createSimple(java.net.URL.class.getName()), URL_FORMAT); in https://github.com/smallrye/smallrye-open-api/blob/8ffefb1bfc45a3a3345f6cd10d3db9d050c4c9ba/core/src/main/java/io/smallrye/openapi/runtime/util/TypeUtil.java#L133
TYPE_MAP.put(DotName.createSimple(java.net.URL.class.getName()), URL_FORMAT);
The text was updated successfully, but these errors were encountered:
/cc @MikeEdgar (swagger-ui), @geoand (kotlin), @phillip-kruger (swagger-ui)
Sorry, something went wrong.
I am going to open an issue against the SmallRye OpenAPI repo that reference this issue, as this will most likely needs to be fixed there.
see smallrye/smallrye-open-api#1924
Successfully merging a pull request may close this issue.
Describe the bug
Any URL (object) in the request body is translated to
In the SwaggerUI. The generated example does not actually work since the request expects a string (e.g. "https://example.com)
Expected behavior
URLs in the request body should be converted to strings.
Actual behavior
URLs in the request body are converted to a dump of the URL object itself.
How to Reproduce?
Reproducer, use REST + REST Jackson + OpenAPI extensions:
Output of
uname -a
orver
Ubuntu
Output of
java -version
Java 21
Quarkus version or git rev
3.12.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.8
Additional information
Perhaps we need a
TYPE_MAP.put(DotName.createSimple(java.net.URL.class.getName()), URL_FORMAT);
in https://github.com/smallrye/smallrye-open-api/blob/8ffefb1bfc45a3a3345f6cd10d3db9d050c4c9ba/core/src/main/java/io/smallrye/openapi/runtime/util/TypeUtil.java#L133The text was updated successfully, but these errors were encountered: