Comments (5)
@soenkehahn You'd have to write your own decoder, but I think it's possible because we know all the fields statically.
from autodocodec.
Thanks for the reply! Are you saying it's possible for me to implement this without modifying autodocodec
? If yes, I'm not sure what you mean by "write your own decoder". Codec
s seem to encompass both encoders and decoders, and I'm not sure how I would go about writing my own decoder while using a provided decoder, if that makes sense. Any pointers appreciated!
from autodocodec.
@soenkehahn Sorry I've not been very clear. It's easy for me to forget context that I only have because I wrote this code.
A codec
is just a value that represents an idea.
This function does the decoding:
autodocodec/autodocodec/src/Autodocodec/Aeson/Decode.hs
Lines 31 to 37 in fa4d53e
You could write your own version to warn or reject on unknown fields.
from autodocodec.
Is it possible to add support for this (decoder?) to the library so that users can configure this behaviour. I know you have already closed this but would you accept a pull request?
from autodocodec.
@Icelandjack I think my "closed" communication was not clear. I just meant that I haven't planned to add it myself. A PR would be welcome!
from autodocodec.
Related Issues (19)
- Generic HasCodec HOT 2
- UTCTime codec HOT 4
- Fails to build with aeson 2 HOT 2
- How to use `oneOf` instead of `anyOf` for `eitherCodec` HOT 5
- Multi-line defaults
- Documentation on how to use type fields HOT 4
- Incorrect openapi when using two `parseAlternative`s HOT 4
- Selective instance? HOT 1
- Sum type encoder in the README HOT 2
- Profunctor instance for `Codec` HOT 3
- `Void` codec? HOT 1
- Arbitrary input validates against `Void` schema HOT 12
- Need help with conditional fields HOT 1
- Make schema order match declaration order? HOT 4
- Recursive discriminated union ToSchema doc generation looping forever HOT 5
- Example in README doesn't compile HOT 1
- aeson-2.2 incompatibity HOT 3
- Appetite for JSON Schema enhancements? HOT 2
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 autodocodec.