Re: Is there a Java library for request/response validation that is framework agnostic?

2016-10-04 Thread Tom Akehurst
Hey James, I'm trying to raise a PR (from https://bitbucket.org/tom_akehurst/swagger-request-validator) to add the missing parameter constraints, but I'm getting 500s from Bitbucket. Any idea what's happening? Cheers, Tom On Tuesday, September 27, 2016 at 8:34:39 AM UTC+1, Tom Akehurst wrote:

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-27 Thread Tom Akehurst
Duh! Yeah, it would help if I looked in the right group! Will take a look at the CLA, but I wouldn't have thought it'd be a problem. Cheers, Tom On Monday, September 26, 2016 at 11:52:08 PM UTC+1, James Navin wrote: > > Hi Tom - glad to hear it might be useful to you. > > I've noticed that only

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-26 Thread James Navin
Hi Tom - glad to hear it might be useful to you. I've noticed that only the POMs are published on Maven central, not the > full artifacts. Is this deliberate? The full artifacts are there - they're just under the sub-modules (e.g. http://repo1.maven.org/maven2/com/atlassian/oai/swagger-request

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-26 Thread Tom Akehurst
Thanks, this is exactly the kind of thing I'm looking for. Wish I'd found this a week ago, as I've nearly finished writing my own impl :-( I've noticed that only the POMs are published on Maven central, not the full artifacts. Is this deliberate? I also noticed there's some work left to do vali

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-25 Thread James Navin
I faced a similar situation and ended up writing my own. Its open source and available at https://bitbucket.org/atlassian/swagger-request-validator Its framework agnostic and has adapters for WireMock (as well as Rest Assured and Pact). Feel free to raise any issues you find on the issue tracke

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-21 Thread Tom Akehurst
Thanks, that's very useful. I'm working on writing a validator now. Hopefully I should be able to open source it in the next few days. On Tuesday, September 20, 2016 at 5:23:50 PM UTC+1, tony tam wrote: > > Yes, there is a JSON schema to describe the swagger specification, and > also the defini

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-20 Thread tony tam
Yes, there is a JSON schema to describe the swagger specification, and also the definitions are a subset of JSON schema. Please take a look here for all the gory details: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-20 Thread Tom Akehurst
Haha, showing my ignorance here. Hadn't realised that the definitions part of a Swagger doc was actually JSON schema. On Tuesday, September 20, 2016 at 4:49:37 PM UTC+1, tony tam wrote: > > What do you mean? > > On Sep 20, 2016, at 8:48 AM, Tom Akehurst > > wrote: > > Is there a way to adapt a S

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-20 Thread Tom Akehurst
Is there a way to adapt a Swagger spec to JSON schema? On Tuesday, September 20, 2016 at 3:38:03 PM UTC+1, Max Goldstein wrote: > > Not only is the inflector tied to a specific stack, it seems to not be > feature-complete. My best idea is to validate incoming requests (and > outgoing responses)

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-20 Thread tony tam
What do you mean? > On Sep 20, 2016, at 8:48 AM, Tom Akehurst wrote: > > Is there a way to adapt a Swagger spec to JSON schema? > > On Tuesday, September 20, 2016 at 3:38:03 PM UTC+1, Max Goldstein wrote: > Not only is the inflector tied to a specific stack, it seems to not be > feature-comple

Re: Is there a Java library for request/response validation that is framework agnostic?

2016-09-20 Thread Max Goldstein
Not only is the inflector tied to a specific stack, it seems to not be feature-complete. My best idea is to validate incoming requests (and outgoing responses) using this json schema validator , adding a custom pass to check for the discrimi

Is there a Java library for request/response validation that is framework agnostic?

2016-09-20 Thread Tom Akehurst
Hello! I'm trying to find a good way to implement the following use case: I'm building a WireMock-based mock of a 3rd party API my project depends on. I'd like to be able to write a suite of tests that can be run against either the real API or the mock, where each HTTP request/response is captu