Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #6923
Closed
Open
Issue created Jul 13, 2020 by Administrator@rootContributor3 of 6 checklist items completed3/6 checklist items

[BUG][Java][jersey2] Date header should be in GMT format, but it has timezone information

Created by: sebastien-rosset

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The java jersey2 library is incorrectly setting the Date header. The date format should be compliant with RFC 7231, which states the time must be set to GMT.

According to RFC 7231, the "Date" header field represents the date and time at which the message was originated. The field value is an HTTP-date, as defined in Section 7.1.1.1. The preferred format is a fixed-length and single-zone subset of the date and time specification used by the Internet Message Format.

IMF-fixdate  = day-name "," SP date1 SP time-of-day SP GMT

For example, the jersey2 library sets the Date header to Mon, 13 Jul 2020 09:47:14 PDT. Expected Output: Mon, 13 Jul 2020 17:47:14 GMT Instead, getting: Mon, 13 Jul 2020 09:47:14 PDT

The date format is set to RFC3339 by default in the generated ApiClient.java. This is the right default value for serialized dates in the HTTP body, but the Date header should be compliant with RFC 7231 format, which is RFC1123.

openapi-generator version

master July 13 2020

OpenAPI declaration file content or url

There is no applicable OpenAPI document. This is a problem setting the value of the Date HTTP header.

Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix

The bug is here: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache#L239

Assignee
Assign to
Time tracking