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

Adding List and Vector to form encoder lifters, AddArg #629

Merged

Conversation

blast-hardcheese
Copy link
Member

Resolves #622

Verified in the console:

scala> implicitly[AddArg[Option[Vector[Long]]]]
res0: issues.issue622.Implicits.AddArg[Option[Vector[Long]]] = issues.issue622.Implicits$AddArg$$anon$1@269e559f

scala> res0.addArg
   def addArg(key: String,v: Option[Vector[Long]]): String

scala> res0.addArg("foo", Some(Vector(1, 2, 3, 4)))
res1: String = foo=1&foo=2&foo=3&foo=4

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

val filteredDtoComponents: Option[NonEmptyList[String]] =
NonEmptyList
.fromList(dtoComponents)
.filter(_ => protocolElems.exists({ case _: RandomType[_] => false; case _ => true }))
Copy link
Member

Choose a reason for hiding this comment

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

Are there any implications for Java here?

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 explicitly to handle the java case 😅 package-info.java never seemed/seems to work for me, so this correctly does not emit the definitons.* import if the only protocolElems we have are just aliases

Copy link
Member

Choose a reason for hiding this comment

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

Ah, neat. We can get rid of package-info.java entirely then.

@blast-hardcheese blast-hardcheese merged commit cb032f5 into guardrail-dev:master May 6, 2020
@blast-hardcheese blast-hardcheese deleted the vector-addArg branch May 6, 2020 22:02
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.

Missing AddArg.addArgVector?
2 participants