Comments (8)
Not sure exactly what you are referring to here. I'm looking for a serializer format that is more the typical looking json formatting.
My current use case is that I am building BuiltValue
classes to represent Json Schema.
I need to be able to serialize/ deserialize from regular json schema documents.
Of course for interoperability with external sources of JSON this is needed too.
If this is not what you are referring to then I'll likely need to look at building something. In which case I'd like your thoughts on whether it makes sense to leverage the code in this repo or not
from built_json.dart.
This issue is just about how the generated code works.
Re: the wire format itself, it's designed for use in RPCs. It's unlikely to match any other specific format. Although, if there's an existing format that happens to cover what's needed, we could switch.
One consideration for example is whether to use a map from field name to field value. This looks nicer. But, it's a lot more expensive than an array, in memory and performance. So in this context arrays are better.
from built_json.dart.
Yeah makes sense for RPCs if you control both ends of the channel.
In many cases you don't though and the map based way seems to be the norm.
I'll play around with generating some Codecs
from built_json.dart.
Right.
I would be fine with supporting multiple formats; if it's an option at code generation time then this wouldn't add any runtime/compile overhead. But there'd need to be a clear use case for each format, of course.
Could you point to a specification of the format you're interested in, please?
from built_json.dart.
Not sure what you are after in terms of specifications. If you mean a spec for how a dart class should be serialized to JSON then I don't think such a spec exists.
However, I am working on is a built_value
representation of json schema.
So this built_value class is intended to be a faithful reproduction of the core schema.
I'm also working on a transformation framework and with that I'll create a bidirectional transformation between Json Schema and a Built Value model. So that will allow me to generate dart classes from a json schema and vice versa.
It would be use a 'typical' representation of json. e.g a class like
abstract class Person implements Built<Person, PersonBuilder> {
String get name;
int get age;
...
}
would serialise like
{
"name": "fred",
"age": 15
}
In cases where you have subtypes that can be deserialized into then it'll likely need a field that identifies the type.
Does that make sense?
from built_json.dart.
http://json-schema.org/example2.html contains an example json schema. I need to be able to serialize/deserialize these examples to/from instances of the Schema
class.
Also http://json-schema.org/schema is another example. It is just json schema represented as json schema
from built_json.dart.
This issue moved to
Nicer generator code: google/built_value.dart#64
Nicer JSON: google/built_value.dart#65
from built_json.dart.
FYI this is now happening over at
from built_json.dart.
Related Issues (20)
- Support serializing nullable fields. HOT 1
- Investigate genericType strictness in serializers
- Possible to use transformers? HOT 2
- Show an error if serializer declaration points to wrong instance HOT 1
- Deserialization code has unused value when there are no fields HOT 1
- Deserialization code should use iterator HOT 1
- Properly detect transitive dependencies. HOT 1
- allow non-concrete serialized types provided all implementations are serializable HOT 2
- Doesn't cope with null value in nullable field HOT 3
- Typo in source_field.dart: MapBuiler HOT 1
- Fix warnings about 'Object'. HOT 1
- the package is not compatible with quiver 0.22.0 HOT 5
- chat example: add dev_dependency on source_gen and build HOT 1
- chat example: readme says server is at "localhost:26199" HOT 2
- Request: option for "pretty" JSON? HOT 2
- BuiltJsonSerializer(s) can probably have shorter names HOT 1
- Null error on deserialize with nested builders HOT 1
- Don't write nulls
- Add serializer context HOT 1
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 built_json.dart.