Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum Class Generation for schema.org/OrderStatus not working #400

Open
stiivo opened this issue Jan 2, 2023 · 2 comments
Open

Enum Class Generation for schema.org/OrderStatus not working #400

stiivo opened this issue Jan 2, 2023 · 2 comments

Comments

@stiivo
Copy link
Contributor

stiivo commented Jan 2, 2023

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

@alanpoulain
Copy link
Member

Probably because OrderStatus is not a direct subclass of Enumeration.
The corresponding code is here, do you want to try to fix it?

public function isEnum(): bool
{
$subClassOf = $this->resource->get('rdfs:subClassOf');
return $subClassOf && self::SCHEMA_ORG_ENUMERATION === $subClassOf->getUri();
}

@stiivo
Copy link
Contributor Author

stiivo commented Jan 2, 2023

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

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

No branches or pull requests

2 participants