Skip to content

#11 Add support for enums without renaming #24

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

Merged
merged 4 commits into from
Jan 4, 2024
Merged

Conversation

jakipatryk
Copy link
Collaborator

Closes #11

Copy link

github-actions bot commented Jan 1, 2024

JaCoCo code coverage report - springdoc-openapi-scala

Overall Project 95.59% -0.37% 🍏
Files changed 96.41% 🍏

File Coverage
OpenAPIModelRegistration.scala 97.53% -0.38% 🍏

Copy link

@TheLydonKing TheLydonKing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read through code, looks good to me

@@ -66,6 +67,7 @@ class OpenAPIModelRegistration(components: Components) {
case t if t <:< typeOf[Option[_]] => handleType(t.typeArgs.head)
case t if t <:< typeOf[Seq[_]] || t <:< typeOf[Array[_]] => handleSeqLike(t)
case t if t <:< typeOf[Set[_]] => handleSet(t)
case t if t <:< typeOf[Enumeration#Value] => handleEnum(tpe)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you pass tpe here and not t?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually can be t. Changed, thanks.

Initially when I was experimenting, I passed tpe as it is not dealiased, and I thought it might be needed non-dealiased. But parentObjectType is fortunately the same whether dealiased or not, so can be t.

assertEnumIsStringAndHasFollowingOptions(actualSchemas, "SimpleEnums.b", Set("Cleaner", "Floor"))
}

it should "make complex Enumeration (with renaming) an OpenAPI enum" ignore { // TODO: #23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What todo is that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is ignored as it currently doesn't pass (this PR adds support only for simple Enumerations). Changed the comment to be more descriptive

@jakipatryk jakipatryk merged commit d3443cd into main Jan 4, 2024
@jakipatryk jakipatryk deleted the feature/11-enums branch January 4, 2024 15:22
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 this pull request may close these issues.

Add support for simple Scala Enumeration
3 participants