imrafaelmerino / json-values Goto Github PK
View Code? Open in Web Editor NEWPersistent Json in Java
Home Page: https://json.values.imrafaelmerino.dev
License: Apache License 2.0
Persistent Json in Java
Home Page: https://json.values.imrafaelmerino.dev
License: Apache License 2.0
MutableMap, ImmutableMap don't have to implement emptyArray
MutableSeq,ImmutableSeq don't have to implement emptyObj
It makes really difficult to combine different map and seq implementations and doesn't make any sense...
releases will be handled by Github.
Benchmarks parsing a string into a json object and arrays have been carried out for json of different sizes. The idea is to develop a new benchmark where multiple threads access concurrently to the Json factories.
integrate travisCI with codecov and add a bade in readme
Version of json-values you are using
all versions
Describe the bug
creation of path from a string doesn't return an error when an index is specified with leading zeroes
To Reproduce
JsPath.of("/a/001") doesn't return an error
Expected behavior
throw UserError with a suggestion removing leading zeroes
The number of methods grows exponentially and a JsPath can be created either from a string (https://tools.ietf.org/html/rfc6901) or from the API with the methods fromIndex, fromKey and index and key, which is already really convenient
to parse a string into a stream of token we are gonna use Jackson instead the customized parser from the Glassfish json implementation
For those rules that don't make sense:
. @SuppressWarning("issue_id")
. Always add a comment explaining why
For those ones that I agree with: fix them
Add info to readme and project page or fixing typos
https://json-schema.org/specification.html
Taking into account https://clojure.org/guides/spec
Implement a way of injecting the generated data to a JUnit 5 test and other PBT existing libraries
UserError -> errors made by users of the library
InternalError -> errors made by developers of the library
in both cases, someone has to fix something.
InternalError should give a suggestion about what to change
Version of json-values you are using
all versions
Describe the bug
remove by index method removes a wrong index
To Reproduce
JsArray.of(1,2,3,4).remove(JsPath.fromIndex(1)) = [2,3,4]
Expected behavior
[1,3,4]
Deploy to Maven repositories and to GitHub Releases. Every time a tagged commit is pushed, a Travis CI build will be triggered automatically and start the release process
JSON Patch is a format for describing changes to a JSON document. It can be used to avoid sending a whole document when only a part has changed.
new method in JsElem interface
All public methods and classes have been well documented. Do the same for none public classes and methods.
It's more convenient for the client to be class methods instead of static methods.
implement isJson, isStr, isNumber without using instance of method
Version of json-values you are using
3.1.0
Describe the bug
Method
public ImmutableJsons withMap(Class<ImmutableMap> map) {
should be
public ImmutableJsons withMap(Class<? extends ImmutableMap> map) {
The current implementation uses persistent data structures from Scala. Other alternatives like:
-PCollections
-vavr
-Clojure
can be explored to pick the one that has the best performance.
json-values uses the custom interfaces MyMap and MyVector and is therefore independent of the implementation.
using path and a static import JsPath.path is way more idiomatic than JsPath.of
wrapping up:
a.b.c becames /a/b/c
a.b+c.d becames #/a/b+c/d
go to https://tools.ietf.org/html/rfc6901 for further details
Some of the non-public classes have the prefix "My" to distinguish from the public classes. It's a bit overkilling
readme, pom and changelog
Leave only functions that work with JsElem
After thinking for a while, I'm going to stick to Scala immutable HashMap and Vector as the underlying data structures of the immutable Json. The API won't provide a way of using others. Ther parsing of a String into a Stream of tokens will be made using Jackson because it's a well-tested library and I don't want to maintain any code related to this task. Some performance optimization has been carried out, and the improvements are significant compared to the previous release; also, the size of the jar is half the size it was.
.
Use JsonParser from Jackson instead of the custom JsParser and compare results
tableswitch makes a great difference in performance
when executing mvn clean test, only the methods which start with test are executed.
For now, I'll add that prefix to the test names
Do some refactor. In previous versions to 3.1.0, MyMap implementations needed to create empty arrays and MySeq implementations needed to create empty objects, that's why there were two generic types.
After version 3.1.0, that tight coupling between seqs and maps has been removed, but those types remain...
//remove V type
interface MyMap<M extends MyMap<M, V>, V extends MySeq<V, M>>
// MySeq is not used in after last release (3.1.0):
interface MyMap<M extends MyMap<M>>
and
// remove M type
interface MySeq<V extends MySeq<V, M>, M extends MyMap<M, V>> extends Iterable<JsElem>
//MyMap is not used in after last release (3.1.0)
interface MySeq<V extends MySeq<V>> extends Iterable<JsElem>
Static factory methods have the inconvenient of making difficult to use different data structures that the specified in them. The JsObj and JsArray are tightly coupled to the underlying data structures. It would be interesting to be able to define factories with custom
data structures. For example, a JsArray could use a list implementation from Eclipse Collections or a vector from Clojure or even a Set from Java. It makes the library more attractive and more object-oriented.
The documentation associated with a release has to be located with the changelog and other documents in GitHub
Enrich readme using badges. Take a look at https://shields.io
break down JsParser into several classes.
reduce complexity
It's a uber jar and a lot of classes from scala are packaged, and they are not needed
change versions in pom
add release name
generate changelog from the commit history
pull request into master and tag master to trigger Travis release process
Create a docs folder, configure settings and water down the readme file and add links to the pages from the site
Version of json-values you are using
2.0.1
Describe the bug
JsObj.parse("").orElseThrow()
returns the message
jsonvalues.MalformedJson thrown: Invalid token=EOF at (line no=1, column no=0, offset=-1). Expected tokens are: [CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL]
Expected behavior
Expected tokens are: [CURLYOPEN, SQUAREOPEN]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.