Hello at all,

I have a swagger definition like this:

/services:
    get:
      parameters:
        - name: begin
          in: query
          required: true
          type: string
          format: date-time
      responses:
        200:
          schema:
            type: object
            properties:
              response_code:
                $ref: '#/definitions/Responsecode'
              services:
                type: array
                items:
                  $ref: '#/definitions/Service'


When I generate serverside code with the swagger editor (Generate Server -> 
JAX-RS) and generate client side code with the swagger editor (Generate 
Client -> Java), run the server code and try to call the get-method, it 
always results in a failure that the called method could not be found. When 
I debug on serverside you can see, that the problem is the parsing of the 
datetime parameter, a format exception is thrown while *new java.util.Date( 
String )*.
To solve the problem I tried to change the generated clientside code. In 
the API-class I use *java.util.Date* instead of *DateTime* 
(yoda-framework). But it does not work, too.
Afterwards I tried to change the generated serverside code. In the 
API-class I changed the parametertype of the parameter *begin *from 
*java.util.Date* to *DateTime* (yoda-Framework). But after that I get a new 
error during starting the server:* Missing dependency for method public 
javax.ws.rs.core.Response 
gen.java.io.swagger.api.ServicesApi.servicesGet(java.lang.String,org.joda.time.DateTime)
 
throws gen.java.io.swagger.api.NotFoundException at parameter at index 1*.
Can anybody help me? What is the problem? I think, the problem is the using 
of the deprecated constructor java.util.Date( String ) without any 
information about the formatting of the string in the generated code.
But the most wondering think is that I generate the server- and clientside 
and it it does not work out of the box :-(

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to