Giter Club home page Giter Club logo

Comments (10)

NarekA avatar NarekA commented on May 27, 2024

Note that removing theMyDocument.other_doc field makes the example work again.

from jina.

JoanFM avatar JoanFM commented on May 27, 2024

Hey @NarekA,

Thanks for reporting the issue. If you have a fix proposal we would be glad to get the contribution

from jina.

NarekA avatar NarekA commented on May 27, 2024

Of these solutions, do any of them make more sense to you?

  1. Use http get with a body. See this link

    Sending a body with a GET request has an undefined behavior in the specifications, nevertheless, it is supported by FastAPI, only for very complex/extreme use cases.

I like this one, but it looks like fastAPI might not include the fields in the docs.

  1. Use a different http method

The best solution if it's possible

  1. Serialize/deserialize the fields before IO.

Might make more sense to serialize the whole object as one param rather than try serializing individual params

Any reason we can't use http post?

from jina.

NarekA avatar NarekA commented on May 27, 2024

@JoanFM Any reason this is using get?

from jina.

JoanFM avatar JoanFM commented on May 27, 2024

@alaeddine-13 may have better insights as per this

from jina.

alaeddine-13 avatar alaeddine-13 commented on May 27, 2024

@NarekA Actually the convention when implementing SSE in HTTP is to use GET methods instead of POST. The drawback of using GET is having to serialize the document as query string parameters. However, developers can use clients that follow the convention when using SSE. For instance, mozilla's js client EventSource implements SSE client using GET method.
I suggest flattening your document schema in case
@JoanFM I remember wanting to include a duplicate POST method for such a case, such that, if you want to follow convention -> use GET endpoint and if you want nested schemas -> use POST endpoint

from jina.

NarekA avatar NarekA commented on May 27, 2024

@alaeddine-13 we are currently working around this by "flattening" the document, but that effectively removes any benefits of the upgrade to Docarray V2. It also means that the framework doesn't support all docarray inputs (for http at least) and that should be communicated. Would it be hard to create a second endpoint? I could look into this one if it helps.

from jina.

JoanFM avatar JoanFM commented on May 27, 2024

We are definitely going to look into solving this issue. Yoy are right, in the Documentation is not stated

from jina.

NarekA avatar NarekA commented on May 27, 2024

@JoanFM @alaeddine-13 I drafted a PR that seems to fix this issue for me: https://github.com/jina-ai/jina/pull/6091/files

from jina.

JoanFM avatar JoanFM commented on May 27, 2024

It seems nice @NarekA,

I added some comments to the PR

from jina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.