Skip to content

JSON response returned as string instead of dict (Flask integration) #6

Open

Description

@francescobianco

JSON response returned as string instead of dict (Flask integration)

Description
SDK returns raw string instead of parsed JSON, adding boilerplate in Flask apps.

Code snippet

from flask import Flask
import json

app = Flask(__name__)

resp = client.request("GET", base_url, "/advance")
data = json.loads(resp)

Issue
Expected automatic JSON decoding.

Activity

  1. Deadpool2000 commented on Mar 18, 2026

    @Deadpool2000
    Contributor

    Hey @francescobianco

    Check this PR #12

  2. IlyasFardaouix commented on Mar 19, 2026

    @IlyasFardaouix

    I think the issue might be due to the fact that the client.request method is returning a raw string instead of a JSON object. Could you try checking the client.request method in openapi_python_sdk.client to see if it's explicitly returning a string or if there's an option to enable automatic JSON decoding?

  3. francescobianco commented on Mar 24, 2026

    @francescobianco
    MemberAuthor

    Good point, thanks @IlyasFardaouix for digging into this.

    We’re currently working on improving the test suite around this area, so things are still being refined. For now, we’re happy to accept any useful contributions that help move this forward.

    Feel free to share ideas or open follow-up PRs if you find something that works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions