Code Monkey home page Code Monkey logo

Comments (6)

KovshefulCoder avatar KovshefulCoder commented on May 26, 2024 1

So, wrote down custom extension for this

from sandwich.

skydoves avatar skydoves commented on May 26, 2024 1

Looks very good to me, @KovshefulCoder. Thanks for sharing your experience with this community. Flexibility is one of the biggest advantages of this library, so it's good to see you make your custom extensions and resolve issues in dedicated ways.

from sandwich.

KovshefulCoder avatar KovshefulCoder commented on May 26, 2024

Example:
image
image
image

FATAL EXCEPTION: main
Process: ..., PID: ...
kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 2: Encountered an unknown key 'error' at path: $
Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys.
JSON input: {"error":"Backend: user ..."}

from sandwich.

skydoves avatar skydoves commented on May 26, 2024

Hey @KovshefulCoder, sorry for the late response. As you said, the error body model must match your backend error body JSON model and its expected result.

from sandwich.

KovshefulCoder avatar KovshefulCoder commented on May 26, 2024

Yes, it should certainly match the JSON model to be converted into a @serializable data class. However, I thibk that since we are discussing within the context of a library that allows working with the results of any request through a simple API, this case should also be converted into ApiResponse to enable processing it with the Sandwich API.

from sandwich.

KovshefulCoder avatar KovshefulCoder commented on May 26, 2024

@skydoves sorry for ping. What do you think?

from sandwich.

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.