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

servlet: jq #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

servlet: jq #55

wants to merge 1 commit into from

Conversation

evacchi
Copy link
Contributor

@evacchi evacchi commented Feb 5, 2025

A simple jq servlet based on the popular jaq library. It applies a JQ expression to a JSON input and returns the result.

Example

You: can you extract the title of the window from this JSON payload?

    {"widget": {
        "debug": "on",
        "window": {
            "title": "Sample Konfabulator Widget",
            "name": "main_window",
            "width": 500,
            "height": 500
        },
        "image": {
            "src": "Images/Sun.png",
            "name": "sun1",
            "hOffset": 250,
            "vOffset": 250,
            "alignment": "center"
        },
        "text": {
            "data": "Click Here",
            "size": 36,
            "style": "bold",
            "name": "text1",
            "hOffset": 250,
            "vOffset": 100,
            "alignment": "center",
            "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
        }
    }}

Assistant: The title of the window from the JSON payload is "Sample Konfabulator Widget".

Signed-off-by: Edoardo Vacchi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant