Skip to content

Conversation

codeliner
Copy link

JsonSchemaAwareRecordLogic can now be enabled to allow nested property schema. This means that if a property type is of JsonSchemaAwareRecord, the property schema is derived from JsonSchemaAwareRecord::__schema() instead of using a type reference.

Collection types can implement JsonSchemaAwareCollection and use JsonSchemaAwareCollectionLogic to be converted to array schema with an item schema.

If a property type class does not implement one of the two JsonAware* classes then the record logic checks existence of named constructors that give a hint to a scalar PHP type represented by the type class.

I've added a bunch of tests that can be used as a reference as well.

@codeliner codeliner merged commit d13dd5f into master May 28, 2019
@codeliner codeliner deleted the feature/improve_schema_detection branch May 28, 2019 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant