title: Unexpected character ('-' (code 45)): Expected space separating root-level values at [Source: 2021-06-06T10:50:00Z; line: 1, column: 6]
body: <p>Using swagger vertx codegen, i have generated some verticle files. In one example, i try to allow the user to pass me a datetime string. My swagger-spec is as follows:</p>
  <pre><code>  /test/my/endpoint:
      post:
        tags:
          - endpoint
        summary: test
        description: test
        operationId: test
        produces:
          - application/json
        parameters:
          - name: from_date
            in: query
            description: |
              The start date for the report. Must be used together with `to_date`.
            required: false
            type: string
            format: date-time
          - name: to_date
            in: query
            description: |
              The end date for the report. Must be used together with `from_date`.
            required: false
            type: string
            format: date-time
        responses:
          '200':
            description: successful operation
            schema:
              $ref: '#/definitions/TestSchema'
          '500':
            description: internal server error
            schema:
              $ref: '#/definitions/TestSchema'
        x-contentType: application/json
        x-accepts: application/json
  </code></pre>
  <p>Vertx-Swagger Codgen then in the verticle generates something like this:</p>
  <pre><code>// in MyApiVerticle.java
  final Handler&lt;Message&lt;JsonObject&gt;&gt; postMyHandler = message -&gt; {
          try {
              OffsetDateTime fromDate = null;
              if(message.body().getString(&quot;from_date&quot;) != null) {
                  fromDate = Json.mapper.readValue(message.body().getString(&quot;from_date&quot;), OffsetDateTime.class);
              } catch (Exception e) { ... }
  }
  </code></pre>
  <p>When i try this endpoint with a string like this:</p>
  <pre><code>2021-06-06T10:50:00Z
  </code></pre>
  <p>I get the following error:</p>
  <pre><code>com.fasterxml.jackson.core.JsonParseException: Unexpected character ('-' (code 45)): Expected space separating root-level values  at [Source: 2021-06-06T10:50:00Z; line: 1, column: 6]
  </code></pre>
  <p>The request being sent looks like this:</p>
  <pre><code>http request:
  http://localhost:8080/api/test/my/endpoint?from_date=2021-06-06T10%3A50%3A00Z&amp;to_date=2021-06-06T11%3A50%3A00Z
  
  curl:
  curl -X 'POST' \
    'http://localhost:8080/api/test/my/endpoint?from_date=2021-06-06T10%3A50%3A00Z&amp;to_date=2021-06-06T11%3A50%3A00Z' \
    -H 'accept: application/json' \
    -d ''
  </code></pre>
  <p>If i print out <code>message.body()</code> i see the following before the exception is thrown:</p>
  <pre><code>{&quot;from_date&quot;:&quot;2021-06-06T10:50:00Z&quot;,&quot;to_date&quot;:&quot;2021-06-06T11:50:00Z&quot;}
  </code></pre>
  <p>If i pass in <code>0</code> for both the <code>from_date</code> and <code>to_date</code> value, it appears to work and the date then becomes `1970-01-01T00:00Z' for both fields.</p>
  <p>How do i fix this? Is the format of the string incorrect? After doing some digging around, it seems correct: <a href="https://swagger.io/docs/specification/data-models/data-types/" rel="nofollow noreferrer">https://swagger.io/docs/specification/data-models/data-types/</a></p>
  <p>The detailed exception:</p>
  <pre><code>com.fasterxml.jackson.core.JsonParseException: Unexpected character ('-' (code 45)): Expected space separating root-level values
   at [Source: 2021-06-06T10:50:00Z; line: 1, column: 6]
      at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1586)
      at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:521)
      at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:450)
      at com.fasterxml.jackson.core.base.ParserMinimalBase._reportMissingRootWS(ParserMinimalBase.java:466)
      at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._verifyRootSpace(ReaderBasedJsonParser.java:1598)
      at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._parsePosNumber(ReaderBasedJsonParser.java:1248)
      at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:705)
      at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3847)
      at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3792)
      at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2797)
      at com.my.testƒƒ.api.MyApiVerticle.lambda$new$0(MyApiVerticle.java:31)
      at io.vertx.core.eventbus.impl.HandlerRegistration.deliver(HandlerRegistration.java:223)
      at io.vertx.core.eventbus.impl.HandlerRegistration.handle(HandlerRegistration.java:200)
      at io.vertx.core.eventbus.impl.EventBusImpl.lambda$deliverToHandler$3(EventBusImpl.java:533)
      at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:834)
  </code></pre>
  <p>Any help would be appreciated!</p>