Commit graph

17 commits

Author SHA1 Message Date
Benjamin Neff
6f936caddf
Add abstract OptionalAwareValidator class
This improves validation of optional fields and respects the `optional`
option of properties
2017-09-03 20:10:24 +02:00
Benjamin Neff
bb40d6190d
Only add optional nil values to relayable XML when needed for signature order 2017-07-30 00:32:54 +02:00
Benjamin Neff
f5ff4a71e6
Only add optional properties to generated XML and JSON when not nil 2017-07-30 00:32:54 +02:00
Benjamin Neff
e26a86c173
Switch PercentLiteralDelimiters to new default
Let's change that to the new rubocop default, which is also the
suggestion in the ruby style guide.

See https://github.com/bbatsov/ruby-style-guide#percent-literal-braces

This was changed in diaspora too, see diaspora/diaspora#7466

It also includes the changes in the code. This was done with
`rubocop --auto-correct` and no we have zero offenses again.
2017-06-30 02:23:44 +02:00
Benjamin Neff
c0ea38d258
Improve logging when validation fails
Add guid and author to error messages if available.
2017-06-11 16:01:04 +02:00
Benjamin Neff
87033e4cd6
Remove legacy signature ordering
Relayables are now ordered by the order of the properties of the entity.

Related to #26, but still compatible with pods older than 0.6.3.0.
2017-05-10 02:37:22 +02:00
cmrd Senya
c58d076c96
Entity JSON serialization/deserialization feature 2017-03-23 13:55:19 +02:00
Benjamin Neff
ef21f5c0d6 Add tests for integer and timestamp parsing 2017-01-10 00:22:27 +01:00
cmrd Senya
a1c9998d40 fix boolean pattern parse 2017-01-04 06:32:41 +03:00
Benjamin Neff
dd1c16ce91 add types for string properties 2016-12-28 02:43:16 +01:00
Benjamin Neff
26b7991def handle empty xml-elements for nested entities 2016-07-12 03:04:09 +02:00
Benjamin Neff
4bde03e2de use RelatedEntity as normal nested entity, but don't add it to xml 2016-06-05 04:13:55 +02:00
Benjamin Neff
6838391cc9 refactored Entity.entity_name and XmlPayload.entity_class_name
write tests and simplified regexes.
2015-09-25 02:37:22 +02:00
Benjamin Neff
ed52108cc7 validate entities after creation if a validator is defined 2015-07-25 03:23:23 +02:00
Benjamin Neff
71b1d6dc1e add xml_name option to properties_dsl
also:
* only allow symbols as name and xml_name
* use public_send instead of send
2015-07-24 23:42:35 +02:00
Benjamin Neff
c65ad965b3 add Person and Profile entity for discovery-data 2015-07-18 23:19:30 +02:00
Benjamin Neff
e955ef8966 add Entity and PropertiesDSL 2015-07-08 01:45:57 +02:00