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

Error in API cURL option, JSON malformed and missing closing } on tweaks object #1933

Closed
SonicDMG opened this issue May 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@SonicDMG
Copy link
Collaborator

Describe the bug
The tweaks object is missing its closing } which causes a JSON error rendering the cURL command inoperable

Browser and Version

  • Warp terminal
  • Version v0.2024.05.14.08.01.stable_04

To Reproduce
Steps to reproduce the behavior:

  1. Create a working flow
  2. Click on the API button in the lower right
  3. Copy the cURL output and paste into terminal
  4. Execute the command

Screenshots
https://www.loom.com/share/e4a72b81515c4776bd23408d8bf62d72?sid=f93c9b5e-253b-4180-a387-c2478f602c0f

Screenshot 2024-05-20 at 3 23 51 PM

Additional context
Add any other context about the problem here.

Copy link

dosubot bot commented May 20, 2024

To address the issue with the malformed JSON output from the cURL command in the Warp terminal, specifically the missing closing } for the tweaks object, you should start by reviewing the code responsible for generating this JSON. Ensure that every opening { has a corresponding closing }. If the tweaks object is dynamically generated, closely inspect the logic to ensure it correctly constructs a valid JSON structure.

For debugging:

  • Use JSONLint or a similar tool to validate the JSON output for syntax errors.
  • Implement logging around the JSON generation logic to catch where the structure might be malformed.
  • Consider automated tests to validate the JSON structure, especially if it's dynamically generated.

The issue seems unrelated to the TypeScript (TSX) code snippets provided, as they pertain to a React component rather than JSON output generation. However, if the JSON is being generated or manipulated within this component or its logic, ensure all objects are correctly closed.

The Langflow repository's handling of the JSON output, including the tweaks object, involves several components and functions. The getCurlCode function, for example, is crucial as it handles JSON formatting for the cURL command. Reviewing how this function and others related to the API call and JSON generation are implemented might provide insights into where the missing closing bracket issue originates.

Significant updates in the Langflow repository, such as the transition from version 0.6 to 1.0, have introduced changes that could potentially affect JSON structure and functionality. These updates emphasize the need for projects to explicitly define Inputs and Outputs, which could impact how data is structured and visualized.

If further assistance is needed, providing more details about the error message, the exact JSON output, and any relevant code snippets or configurations would be helpful for more targeted advice.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the bug Something isn't working label May 20, 2024
@anovazzi1
Copy link
Contributor

fixed in a36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants