Add UUID json format
This PR adds an instance of JsonFormat[UUID] as requested in https://github.com/spray/spray-json/issues/243.
I'm not sure as to where to place this object, currently BasicFormats is my best guess, but feel free to request any changes.
Closes https://github.com/spray/spray-json/issues/243
@atararaksin UUID.fromString behaves differently on different versions of Java and allows illegal (or non standart) string values...
Please consider to pick a more efficient and stable implementation, like here or here
@plokhotnyuk Thanks for pointing that out. I guess including fast-uuid as an external dependency is not a good option. Would it be appropriate (e.g. from the legal perspective) to borrow the implementation from jsoniter-scala?
@atararaksin 1st one (from fast-uuid) is for sequences of characters.
While 2nd one (from jsoniter-scala) is for array of bytes - feel free to reuse if you will find something suitable there.
This addition should make sure that uuid's follow RFC 4122, have a look at https://github.com/akka/akka-http/pull/2569 and https://github.com/akka/akka-http/pull/2596 for inspiration.
@Philippus IMHO validation of the hexadecimal representation with dashes is enough... and limiting of allowed Msb bits will broke backward compatibility with NCS and custom extensions.
Also, using of regexp for that can be revised for more efficient implementation