Skip to content

Conversation

@selliera
Copy link
Contributor

@selliera selliera commented Oct 10, 2019

Use the standard jax-rs @ForParam instead of @multipart for
application/x-www-form-urlencoded parameters

If not, the cxf-cdi code build, but the service does not work, since it expects multipart content, and not x-www-form-urlencoded

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

When using jaxrs-cxf-cdi, www-x-form-urlencoded parameters are declared with @multipart in the api, where it should be @FormParam.

@bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog

Use the standard jax-rs @ForParam instead of @multipart for
application/x-www-form-urlencoded parameters
@selliera selliera changed the title [cxf-cdi] use @FormParam for form parameters when it is not Multipart [JaxRS-Java] use @FormParam for form parameters when it is not Multipart Oct 13, 2019
@wing328 wing328 added this to the 4.2.0 milestone Oct 13, 2019
Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

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

Tested locally and the no compilation issue found.

@wing328 wing328 merged commit 7b794f0 into OpenAPITools:master Oct 13, 2019
@wing328
Copy link
Member

wing328 commented Oct 13, 2019

I'll update the petstore sample in another PR.

jimschubert added a commit that referenced this pull request Oct 14, 2019
* master: (78 commits)
  Replaced dashes with underscores in build.gradle files. (#4092)
  [cxf-cdi] use @FormParam for form parameters when it is not Multipart (#4125)
  Corrections to script names (#4135)
  [python] Add missing keywords python (#4134)
  Update PULL_REQUEST_TEMPLATE.md (#4080)
  revert the fix to broken links
  Rename property name from propertyRawName to propertyBaseName (#4124)
  [Go] Fix go.mod and go.sum for 1.13 (#4084)
  [kotlin] add option for non public api (#4089)
  Added new discriminator RawName property to preserve declared discriminator for @JsonTypeInfo annotations (#3320)
  Fix links to other files (#4120)
  [JAVA][JAXRS] Fix parameters validation (#3862)
  Make Resttemplate thread safe by using the withHttpInfo pattern used by many other generated clients (#4049)
  Disabling linting for typescript-fetch (#4110)
  [Kotlin][Client] fix missing curly bracket when the model contains enum property (#4118)
  Fix NPE in Elm path parameter (#4116)
  test aiohttp first (#4117)
  add back ruby client folders
  update petstore samples
  [CLI] Initial implementation for batch generation (#3789)
  ...
@selliera selliera deleted the cxf-cdi-formparam branch October 15, 2019 12:22
@wing328
Copy link
Member

wing328 commented Oct 31, 2019

@selliera thanks for the PR, which has been included in v4.2.0 release: https://twitter.com/oas_generator/status/1189824932345069569

@BSchneppe
Copy link

i ran into a similar issue when using jaxrs-cxf-client, the other formParams.mustache files in JavaJaxRS may also need the same adjustment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants