Skip to content

For enum definitions without a type definition inherit the type from the enum values #30

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

Closed
wol-soft opened this issue Feb 2, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@wol-soft
Copy link
Owner

wol-soft commented Feb 2, 2021

A given schema:

"type": "object",
"properties": {
  "type": {
    "enum": [0, 1]
  }
}

should be able to detect the type integer for the property type to generate the class interface

public function setType(int $type): self;
public function getType(): int;
@wol-soft wol-soft added the enhancement New feature or request label Feb 3, 2021
@wol-soft wol-soft self-assigned this Feb 5, 2021
@wol-soft wol-soft added this to the 0.20.0 milestone Feb 5, 2021
wol-soft added a commit that referenced this issue Feb 5, 2021
…the enum doesn't provide type information (#30)

Throw a schema exception if an empty enum is detected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant