-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add tests for encoding with multipart/form-data #624
Conversation
Can one of the admins verify this patch? |
The javadoc is a little scatter-shot and inconsistent, so I'm also not sure whether there's a good reason that it's only mentioned in one place. I think your current change that just updates the information where we do have it is the right approach. |
@APIResponse(responseCode = "200", description = "Review deleted", | ||
content = @Content(encoding = @Encoding(name = "enigma", style = "pipeDelimited", explode = true, | ||
allowReserved = true, contentType = "multipart/form-data"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name
needs to be the name of a property included in the schema, see https://spec.openapis.org/oas/v3.1.0.html#media-type-object
Note that @Content
corresponds to a Media Type Object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, from the Encoding Object part of the spec:
style
: ... This property SHALL be ignored if the request body media type is notapplication/x-www-form-urlencoded
ormultipart/form-data
.
(similar text forexplode
andallowReserved
)
I think this means these properties only make sense when applied to the content of a request body where its media type is multipart/form-data
. (Which makes sense I think, multipart/form-data
is a type sent by web browsers when the user submits a form).
Note that this is not the contentType
of the @Content
annotation, it's the value of @Consumes
on the method.
Tbh, I'm not that familiar with receiving form data using Jakarta REST, I would probably start by looking up an example and then trying to add the OpenAPI documentation.
65f8abf
to
4577950
Compare
tck/src/main/java/org/eclipse/microprofile/openapi/apps/airlines/resources/ZepplinResource.java
Outdated
Show resolved
Hide resolved
4577950
to
4207f81
Compare
tck/src/main/java/org/eclipse/microprofile/openapi/apps/airlines/resources/ZepplinResource.java
Outdated
Show resolved
Hide resolved
08d29ae
to
4207f81
Compare
tck/src/main/java/org/eclipse/microprofile/openapi/apps/airlines/resources/ZepplinResource.java
Show resolved
Hide resolved
I had a look at this from the point of view of whether it's a valid resource method. As far as I could find, there's no built-in support required for However, in that case it would be treated as any other media type without built-in support and the Jakarta REST implementation would attempt to look up a Given this process, I think this method is a valid resource method, even if a compatible implementation may throw a Another option might be to use |
d57eac5
to
d2637fb
Compare
tck/src/main/java/org/eclipse/microprofile/openapi/apps/airlines/resources/ZepplinResource.java
Outdated
Show resolved
Hide resolved
bdc389d
to
34fd07d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think this looks good now. Ideally we would squash all the commits.
Squashed commits and removed merges. |
@eclipse-microprofile-bot test this please |
Fixes #587
Depends on #616
For the comments there was mention of "Shall be ignored if not ... www-form-urlencoded or or multipart/form-data" in several places in the spec, but only one mention of "Shall be ignored if not ... www-form-urlencoded" in the current comments. I wasn't sure if I should only update the existing one or if I should add new ones too all. I decided there might be a good reason the other methods don't have that, but if you want them all say so and I'll add them.