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

Validate the GAECV before processing #9

Open
jvanzyl opened this issue Sep 6, 2021 · 3 comments
Open

Validate the GAECV before processing #9

jvanzyl opened this issue Sep 6, 2021 · 3 comments

Comments

@jvanzyl
Copy link

jvanzyl commented Sep 6, 2021

Probably need to perform some basic validation to make sure the input conforms to:

<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>

 jvanzyl$ gavsearch com.fasterxml.jackson.core:jackson-core
Searching for `com.fasterxml.jackson.core:jackson-core` on search.maven.org...
javax.ws.rs.ProcessingException: RESTEASY003145: Unable to find a MessageBodyReader of content-type text/plain and type class gavsearch$MvnSearchResult
	at org.jboss.resteasy.core.interception.jaxrs.ClientReaderInterceptorContext.throwReaderNotFound(ClientReaderInterceptorContext.java:47)
	at org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:133)
	at org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:75)
	at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:214)
	at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:88)
	at org.jboss.resteasy.specimpl.AbstractBuiltResponse.readEntity(AbstractBuiltResponse.java:262)
	at gavsearch.call(gavsearch.java:81)
	at gavsearch.call(gavsearch.java:44)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1783)
	at picocli.CommandLine.access$900(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2150)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2144)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2108)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1975)
	at picocli.CommandLine.execute(CommandLine.java:1904)
	at gavsearch.main(gavsearch.java:63)
@quintesse
Copy link
Contributor

It's an issue with how we call the API. On their website something like com.fasterxml.jackson.core:jackson-core gets translated to: g:com.fasterxml.jackson.core AND a:jackson-core. The parsing of that is done in their web page, so the API only takes that more complex query syntax. We'll have to fix that.

@jvanzyl
Copy link
Author

jvanzyl commented Sep 7, 2021

I just chatted with @maxandersen, I'm happy to submit a PR.

@quintesse
Copy link
Contributor

Btw these are their docs:

By coordinates

Group:

  • g:junit

Artifact:

  • a:junit

Version:

  • v:4.11

Packaging:

  • p:jar
  • p:war

Classifier:

  • l:sources
  • l:javadocs

You can also search in combinations, using the "and" keyword: g:junit and v:4.11

By classes
Class name

  • c:JUnit4
    Full class name
  • fc:org.sonatype.nexus
    By checksums
    SHA-1
  • 1:2973d150c0dc1fefe998f834810d68f278ea58ec

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

No branches or pull requests

2 participants