Closed apoorvdwi closed 5 months ago
@ashitaprasad @animator please review this PR Let me know if you face any difficulties in running the code
I'm pasting a few screenshots of code runs just in case
POST 2 & POST 3 generated code is giving incorrect output.
Response body: {"detail":[{"type":"model_attributes_type","loc":["body"],"msg":"Input should be a valid dictionary or object to extract fields from","input":"{\n\"text\": \"I LOVE Flutter\"\n}","url":"https://errors.pydantic.dev/2.6/v/model_attributes_type"}]}
Response code: 422
Expected Output:
Response body: {"data":"i love flutter"}
Response code: 200
Also HEAD2 is
codeGen.getCode(
CodegenLanguage.javaHttpClient, requestModelHead2, "http"),
expectedCode);
instead of
codeGen.getCode(
CodegenLanguage.javaHttpClient, requestModelHead2, "https"),
expectedCode);
@ashitaprasad @animator fixed the head2 testcase and json body type parsing
Thanks for the PR. LGTM 🚀
PR Description
This PR fixes the Java http client codegen and adds the relevant tests.
Related Issues
Checklist
main
branch before making this PRflutter test
) and all tests are passingAdded/updated tests?
We encourage you to add relevant test cases.
Steps to run
Java code is relatively hard to run on local machine due to install overheads which is why I prepared a simple dockerfile given below
1.png
or change in the dockerfile and image can be used in formdata with path/usr/src/myapp/<filename>