Skip to content

Schema mismatch between TypeScript and Python services #620

@sagikazarmark

Description

@sagikazarmark

Below is the schema for the exact same service implemented in Python and TypeScript:

Image

The problematic call is the getStatus handler that doesn't have any parameters at the moment.

As you can see in the image above, the Python service correctly infers the schema with no input.

The TypeScript one on the other hand expects an empty JSON input.

This is a problem when trying to call a service written in one language from an SDK of the other.

For example: TypeScript sends a Content-Type: application/json header which gets rejected by the ingress, because the Python service schema doesn't have it:

input validation error: Expected body and content-type to be empty, but wasn't with content-type 'Some(\"application/json\")'

I'm not entirely sure which one is the correct behavior, but if I had to guess, it's the Python one (hence the issue in this repo).

The only vaguely related issue I found is #510.

I'm trying to workaround the issue by defining a dummy parameter for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions