schema-generator
schema-generator copied to clipboard
Enum Class Generation for schema.org/OrderStatus not working
API Platform version(s) affected: 3.0.8 Generator: 5.2.0
Description
Enum generation not working for schema.org/OrderStatus Instead OrderStatus becomes a normal Entity
How to reproduce
types:
Thing:
properties:
gender: { range: "https://schema.org/GenderType" }
orderStatus: { range: "https://schema.org/OrderStatus" }
GenderType:
properties:
gender: [ ]
OrderStatus:
properties:
orderStatus: [ ]
$ php vendor/bin/schema generate config/schema.yaml
Probably because OrderStatus is not a direct subclass of Enumeration.
The corresponding code is here, do you want to try to fix it?
https://github.com/api-platform/schema-generator/blob/8b66b379ff1166c98824ff72237cbebd6c2c0256/src/Schema/Model/Class_.php#L69-L74
Hi alan,
thanks for the very fast reply.
I m going to check if there are any other enumeration classes besides Enumeration and StatusEnumeration and submit a pull request when done.
thanks