-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Java Maven Feign x-www-form-urlencoded codegen broken #4908
Comments
I have a similar issue, version feign-*-10.4.2 and feign-form-3.8.0 Params are included but they are camelCase and not as documented. the following openapi 3.0.1 operation /difam/oauth2/realms/root/realms/{realm}/access_token:
post:
operationId: accessTokenRequest
tags:
- openAM
parameters:
- $ref: '#/components/parameters/realm'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/accessTokenRequest'
responses:
200:
description: access token response
content:
application/json:
schema:
$ref: '#/components/schemas/tokenResponse'
components:
parameters:
realm:
name: realm
in: path
description: the realm the request should use
required: true
schema:
type: string
schemas:
grantType:
type: string
enum:
- client_credentials # for the Client Credentials grant flow.
accessTokenRequest:
title: accessTokenRequest
type: object
required:
- client_id
- client_secret
- grant_type
properties:
client_id:
type: string
client_secret:
type: string
grant_type:
$ref: '#/components/schemas/grantType'
scope:
type: string
tokenResponse:
type: object
properties:
access_token:
type: string
scopes:
type: string
token_type:
type: string
expires_in:
description: how many seconds till the token expires
type: integer
results in the following generated code: /**
*
*
* @param realm the realm the request should use (required)
* @param clientId (required)
* @param clientSecret (required)
* @param grantType (required)
* @param scope (optional)
* @return TokenResponse
*/
@RequestLine("POST /difam/oauth2/realms/root/realms/{realm}/access_token")
@Headers({
"Content-Type: application/x-www-form-urlencoded",
"Accept: application/json",
})
TokenResponse accessTokenRequest(@Param("realm") String realm, @Param("clientId") String clientId, @Param("clientSecret") String clientSecret, @Param("grantType") GrantType grantType, @Param("scope") String scope); documentation for reference: https://swagger.io/docs/specification/describing-request-body/ expected:
actual
|
Using the following results in no body being sent at all
I also tried having the template use |
I assume you're using the latest version (4.3.0) What does the correct code look like? if you've fixed the code locally and confirm it works in your case, we can plot the fix back into the template. |
Looks like |
Bug Report Checklist
Description
Maven Generator generates an invalid Feign interface when form encoding required..
openapi-generator version
from pom.xml
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
OpenIdConnectApi.java -
There is a code generator console log message about ignoring form parameters - interface is generated with no method parameters
Related issues/PRs
Seems related to..
#50
Suggest a fix
The text was updated successfully, but these errors were encountered: