Comments (6)
So, wrote down custom extension for this
from sandwich.
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.
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.
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.
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.
@skydoves sorry for ping. What do you think?
from sandwich.
Related Issues (20)
- How to get custom error from my server? HOT 1
- [Help] Is it the best approach to validate responses? HOT 2
- Dependency Dashboard
- EmptyBodyInterceptor doesn't work with GsonConverterFactory HOT 6
- java.lang.NullPointerException:::sandwich.ApiResponse$Failure$Error.toString HOT 2
- After enable R8 full mode getting ParameterizedType error HOT 7
- Maven Central Gradle 8 compatibility
- How to handle data structures like BaseResponse HOT 2
- Integrate Benchmark + Baseline Profiles
- Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option HOT 1
- Interface can't be instantiated! Register an InstanceCreator or a TypeAdapter for this type. HOT 2
- Difference Exception Handling between Ktor and Retrofit HOT 1
- ApiResponseCallAdapterFactory is missing in 2.0.4 HOT 2
- runAndRetry not working when type of ApiResponse had type variable HOT 8
- Any Roadmap to Support Kotlin Multiplatform? HOT 2
- Can I use Sandwich with Mongodb Realm API HOT 1
- Couldn't resolve ApiResponseCallAdapter class HOT 1
- Global ApiResponseFailureMapper not returning desired results HOT 1
- [ASK] Best Practices For Merging Network Call Data into Custom Model.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sandwich.