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

Improve scope of validation warning errors #305

Closed
jerseyrobot opened this issue Jan 22, 2008 · 11 comments
Closed

Improve scope of validation warning errors #305

jerseyrobot opened this issue Jan 22, 2008 · 11 comments

Comments

@jerseyrobot
Copy link
Contributor

If a resource class has 2 GET's with same media types but different parameter
lists, the deployment is OK and the generated WADL would have both method listed.

I think if the usage is wrong deployment should fail in the first place, also
any validations should catch it during design time. Specs/documentation should
also make it clear, if not already.

Environment

Operating System: All
Platform: All

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Reported by ntn@java.net

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Was assigned to jersey-issues

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
ntn@java.net said:
correct issue summary

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
sandoz@java.net said:
Yes, this is a validation issue, that should result in a deployment error or a
warning.

There are a whole bunch of these we need to enumerate in the spec and check for
in the implementation.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
sandoz@java.net said:
More generally the same validation error/warning should be produced for Java
methods with different method names and signatures but the same consuming media
(and URI paths, if present).

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
japod@java.net said:
I think, we need to add some more validation tests to
BasicValidator#visitAbstractResource method
in the first place.

Later on, if performance tests will prove it is needed,
we can update the validation schema (it uses visitor pattern),
so that it will keep a context information when validating
individual methods, so that we could save one iteration loop.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
sandoz@java.net said:
Another case two sub-resource resource methods or locators:

class R {
@path("x") @get String getX()

{ ... }
@path("x") @get String getX() { ... }

}

In addition the following would need to be checked as well:

class R {
@path("x") @get String getX()

{ ... }
@path("x/") @get String getX() { ... }

}

as matching of terminated and non-terminated '/' paths as above is equivalent.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
japod@java.net said:
All mentioned cases are now being checked during resource model validation.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Marked as fixed on Sunday, September 7th 2008, 6:22:47 pm

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JERSEY-33

@jerseyrobot
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant