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

Fix some Endpoint::doc field usages && Rename it to documentation to avoid this kind of mistake in the future #3044

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

guizmaii
Copy link
Member

No description provided.

… to avoid this kind of mistake in the future
@@ -575,7 +575,7 @@ final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](
output = ((HttpCodec.content[Output2] ++ StatusCodec.status(status)) ?? doc) | self.output,
error,
codecError,
Doc.empty,
Copy link
Member Author

@guizmaii guizmaii Aug 22, 2024

Choose a reason for hiding this comment

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

I don't understand why using myEndpoint.out[...](status = ..., doc = ...) would reset the doc to an empty one. Probably a typo

@@ -593,7 +593,7 @@ final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](
output = (HttpCodec.content[Output2](mediaType) ++ StatusCodec.Ok ?? doc) | self.output,
error,
codecError,
doc,
Copy link
Member Author

Choose a reason for hiding this comment

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

This was not using the correct doc. It was using the one passed in parameter and not the one from this

@@ -612,7 +612,7 @@ final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](
output = ((HttpCodec.content[Output2](mediaType) ++ StatusCodec.status(status)) ?? doc) | self.output,
error,
codecError,
doc,
Copy link
Member Author

Choose a reason for hiding this comment

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

This was not using the correct doc. It was using the one passed in parameter and not the one from this

@@ -451,7 +451,7 @@ object OpenAPI {

// todo maybe not the best regex, but the old one was not working at all
// safe chars from RFC1738 "$" | "-" | "_" | "." | "+"
val validPath: Regex = """\/[\/a-zA-Z0-9\-_{}$.+]*""".r
private val validPath: Regex = """\/[\/a-zA-Z0-9\-_{}$.+]*""".r
Copy link
Member Author

Choose a reason for hiding this comment

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

Not related to the main subject of this PR but I've seen that this implementation detail was public. I think we can make it private

@github-actions github-actions bot added the bug Something isn't working label Aug 22, 2024
@guizmaii guizmaii marked this pull request as ready for review August 22, 2024 07:46
@987Nabil 987Nabil merged commit 544adf0 into main Aug 22, 2024
65 checks passed
@987Nabil 987Nabil deleted the openapi_valide branch August 22, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants