[Python] How to write python method for Swagger GET?

Discussão em 'Python' iniciado por Stack, Junho 16, 2025.

  1. Stack

    Stack Membro Participativo

    This is my API

    [​IMG]

    I tried

    def get_component(self, sourceCodeRepository: str):
    # Create Query
    url = f"/management/api/v1/components"

    resp = self.get_resource(url, params={"sourceCodeRepository": sourceCodeRepository})
    result = json.loads(resp)
    print( type(result))

    return result


    got error

    TypeError: the JSON object must be str, bytes or bytearray, not Response


    what should I change?

    Continue reading...

Compartilhe esta Página