cancel
Showing results for 
Search instead for 
Did you mean: 

Specifying Encoding For Form Data Parameters

SOLVED
Highlighted
Regular Visitor

Specifying Encoding For Form Data Parameters

Hello,

 

My question is specific to jaxrs2 integration and could be summarised as the following:

"What does the path look like to fleshing out jaxrs2 integration such that it can be used to generate all aspects of the OpenAPI 3.0 specification, esp. with regards to its priority relative to other aspects of the Swagger Core project?"

 

The rest is a specific example of functionality missing in jaxrs2 integration, including my initial efforts to implement that functionality in the swagger-jaxrs2 module.

 

I've come to understand that swagger-jaxrs2 can handle turning method parameters annotated FormParam into the appropriate request body in the resulting specification. My problem comes from not being able to specify the encoding on the parameters as this document indicates in the "Form Data" section.

 

The Swagger UI project compounds this problem by not using the correct default serialisation for form parameter arrays ("correct" according to the same document linked above).

 

I implemented a proof of concept pull request for a way to specify request body encoding in these circumstances by specifying the encoding on the RequestBody annotation on the method. From my exploration it seemed that allowing this type of customisation via a Parameter annotation on each parameter would have increased the complexity greatly unless the code for processing parameters annotated with FormParam itself was more largely re-examined.

 

If there is some way to do this already then some guidance towards that solution (and the documentation for it) would be greatly appreciated.

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff

Re: Specifying Encoding For Form Data Parameters

Hi,

 

I am not sure I fully understand what you mean with:

 

"What does the path look like to fleshing out jaxrs2 integration such that it can be used to generate all aspects of the OpenAPI 3.0 specification, esp. with regards to its priority relative to other aspects of the Swagger Core project?"

 

But if I get this right you are looking for some refactor of the module to better handle processing/resolving; while this would be indeed good, we don't have planned it for short term, as always any help is more then welcome.

 

For your specific question/comment, many thanks for the PR providing a possible solution; this has been replaced by https://github.com/swagger-api/swagger-core/pull/3696 which adds support for `@Parameter` resolving, please give it a try and see if it solves your issue (if not, please add comments/follow ups to https://github.com/swagger-api/swagger-core/issues/3643)

View solution in original post

1 REPLY 1
Highlighted
Staff

Re: Specifying Encoding For Form Data Parameters

Hi,

 

I am not sure I fully understand what you mean with:

 

"What does the path look like to fleshing out jaxrs2 integration such that it can be used to generate all aspects of the OpenAPI 3.0 specification, esp. with regards to its priority relative to other aspects of the Swagger Core project?"

 

But if I get this right you are looking for some refactor of the module to better handle processing/resolving; while this would be indeed good, we don't have planned it for short term, as always any help is more then welcome.

 

For your specific question/comment, many thanks for the PR providing a possible solution; this has been replaced by https://github.com/swagger-api/swagger-core/pull/3696 which adds support for `@Parameter` resolving, please give it a try and see if it solves your issue (if not, please add comments/follow ups to https://github.com/swagger-api/swagger-core/issues/3643)

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors