Skip to content
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 string limit 64kb, longer than Trip Parser's input #60

Closed
tsolakoua opened this issue Mar 20, 2020 · 4 comments
Closed

Java string limit 64kb, longer than Trip Parser's input #60

tsolakoua opened this issue Mar 20, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@tsolakoua
Copy link
Member

Description

Tried to implemented support for Trip Parser #28. The string created for the POST can't be handled because it exceeds the 64kb limit and returns the error "constant string too long".

Steps to Reproduce

Switch to #59 and run the following code by replacing the base64string with the actual base64 from the swagger.
String body = "{\"data\":{\"type\":\"trip-parser-job\",\"content\":\"base64string\"}}"; TripParser tripParser = amadeus.travel.tripParserJobs.post(body);

Expected Behavior: Starts parsing job

Actual Behavior: constant string too long

@tsolakoua tsolakoua added the help wanted Extra attention is needed label Mar 20, 2020
@chaudharydeepak
Copy link

Hi @tsolakoua I can try helping out with this - pls let me know if its ok. Thank you.

@tsolakoua
Copy link
Member Author

Hello @chaudharydeepak. Thank you so much for your interest in the issue. Definitely, feel free to have a look at it. At any point let us know if you need more information or anything that could be useful. To help you get started, make sure you went through the contributor's guide.

@tsolakoua
Copy link
Member Author

Closed with #104

@1hamidreza
Copy link

1hamidreza commented Nov 18, 2021

Hello,
If the issue is still there I am suggesting to change the body field in the request to byte[] instead of String and create related method for String to be backward compatible. Like the below :

public class Request {
    private byte[] body;
    
    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    public String getBodyString() {
        return Arrays.toString(body);
    }

    public void setBodyString(String body) {
        this.body = body.getBytes(StandardCharsets.UTF_8);
    }
}

It seems that 64K limitation is not there for byte[] and if someone wants to send a really big body (more than 64K) then should use related setBody with byte[] input.
Do you think this can help ?

_Hamid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants