Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

In RAML1 to OAS3 conversion, header examples should be preserved #49

Open
jsamr opened this issue Aug 20, 2018 · 0 comments
Open

In RAML1 to OAS3 conversion, header examples should be preserved #49

jsamr opened this issue Aug 20, 2018 · 0 comments

Comments

@jsamr
Copy link

jsamr commented Aug 20, 2018

Currently, header examples are lost while they are supported in OAS3. They are not designated as a lost semantic, so they should be included in header schema.

RAML 1 source

#%RAML 1.0
title: headers example
version: 1
/last-article:
 get:
   description: Get latest article
   responses:
     200:
       headers:
         Last-Modified-By:
           description: Author of latest modification.
           example: UTF-8'fr'Jean-Pierre%20Dupont

Expected output (yaml+json)

{
  "openapi": "3.0.0",
  "info": {
    "title": "headers example",
    "version": "1"
  },
  "servers": [],
  "paths": {
    "/last-article": {
      "get": {
        "responses": {
          "200": {
            "description": "",
            "headers": {
              "Last-Modified-By": {
                "description": "Author of latest modification.",
                "schema": {
                  "type": "string",
                  "example": "UTF-8'fr'Jean-Pierre%20Dupont"
                }
              }
            }
          }
        },
        "description": "Get latest article",
        "operationId": "GET_last-article"
      }
    }
  },
  "components": {
    "schemas": {},
    "responses": {},
    "parameters": {},
    "examples": {},
    "requestBodies": {},
    "headers": {},
    "securitySchemes": {},
    "links": {},
    "callbacks": {}
  }
}

Observed output (yaml+json)

{
  "openapi": "3.0.0",
  "info": {
    "title": "headers example",
    "version": "1"
  },
  "servers": [],
  "paths": {
    "/last-article": {
      "get": {
        "responses": {
          "200": {
            "description": "",
            "headers": {
              "Last-Modified-By": {
                "description": "Author of latest modification.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "description": "Get latest article",
        "operationId": "GET_last-article"
      }
    }
  },
  "components": {
    "schemas": {},
    "responses": {},
    "parameters": {},
    "examples": {},
    "requestBodies": {},
    "headers": {},
    "securitySchemes": {},
    "links": {},
    "callbacks": {}
  }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant