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

nullable enums not properly described #2177

Closed
DjordyKoert opened this issue Jan 4, 2024 · 1 comment · Fixed by #2178
Closed

nullable enums not properly described #2177

DjordyKoert opened this issue Jan 4, 2024 · 1 comment · Fixed by #2178

Comments

@DjordyKoert
Copy link
Collaborator

Found in #2112 (comment)

Ah yup that would make more sense, that is also the way it is described to do it here https://swagger.io/docs/specification/data-models/enums/.
But I also think this is just a problem with the way enums are currently described as can be seen here:

if ($types[0]->isNullable()) {
$weakContext = Util::createWeakContext($property->_context);
$property->nullable = true;
$property->oneOf = [new OA\Schema(['ref' => $this->modelRegistry->register(new Model($type, $groups)), '_context' => $weakContext])];
return;
}

Enum's should not be handled here, because they are quite simple schema's. I will go ahead and create a different issue for this.

@bnowak
Copy link
Contributor

bnowak commented Feb 29, 2024

Hello, I've created draft PR connected to this topic. It seems that this PR fixed nullable enums for OAS 3.0, but unfortunately broke it for OAS 3.1.

@DjordyKoert could we re-open this issue to follow the topic for OAS 3.1 here?

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 a pull request may close this issue.

2 participants