We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Jane version(s) affected: 6.0.2
Description For a given json-schema, I have a property that can be null or reference an other object.
The code generated add MyObject|null in phpdoc, but not in typehint for function : ->getProp(): MyObject (instead of ->getProp(): ?MyObject
MyObject|null
->getProp(): MyObject
->getProp(): ?MyObject
How to reproduce
Reproduced with this json-schema
{ "id": "Test", "type": "object", "properties": { "id": { "oneOf": [ {"type": "null"}, {"$ref": "#/definitions/id"} ] } }, "definitions": { "id": { "properties": { "uuid": { "type": "string" } }, "type": "object" } } }
Additional context
Note, I also tested with following JSON
{ "id": "Test", "type": "object", "properties": { "id": { "type": ["object", "null"], "allOf": [ {"$ref": "#/definitions/id"} ] } }, "definitions": { "id": { "properties": { "uuid": { "type": "string" } }, "type": "object" } } }
For getter and setter in my Test model, it works :
/** * @return TestId|null */ public function getId() : ?TestId { return $this->id; } /** * @param TestId|null $id * * @return self */ public function setId(?TestId $id) : self { $this->id = $id; return $this; }
But I have two model generated for Id, a TestId and a Id. I would expect that only generate the Id one.
TestId
Id
Thank in advance 🙂
The text was updated successfully, but these errors were encountered:
Ref.: OAI/OpenAPI-Specification#1368
Sorry, something went wrong.
Still present in v7. I will try to fix it.
Successfully merging a pull request may close this issue.
Jane version(s) affected: 6.0.2
Description
For a given json-schema, I have a property that can be null or reference an other object.
The code generated add
MyObject|null
in phpdoc, but not in typehint for function :->getProp(): MyObject
(instead of->getProp(): ?MyObject
How to reproduce
Reproduced with this json-schema
Additional context
Note, I also tested with following JSON
For getter and setter in my Test model, it works :
But I have two model generated for Id, a
TestId
and aId
.I would expect that only generate the
Id
one.Thank in advance 🙂
The text was updated successfully, but these errors were encountered: