Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Property 'format' not supported in a RAML 1.0 shape node #72

Open
benthurley82 opened this issue Mar 5, 2020 · 1 comment
Open

Property 'format' not supported in a RAML 1.0 shape node #72

benthurley82 opened this issue Mar 5, 2020 · 1 comment
Labels
amf Related to AMF issue, bug or specific behavior bug Something isn't working

Comments

@benthurley82
Copy link

benthurley82 commented Mar 5, 2020

I have been using this API to convert an API spec from OAS 2.0 to RAML 1.0 like so.

    WebApiDocument doc = (WebApiDocument) Oas20.parse(oas20).get();    
    raml10 = Raml10.generateString(doc).get();

However, the resulting RAML has a number of errors, one of these is that any Date type attributes have the error from the title. "Property 'format' not supported in RAML 1.0 shape node"

e.g. OAS 2.0

      "properties": {
        "dateOfBirth": {
          "type": "string",
          "format": "date",
          "example": "1977-12-27",
          "description": "Date of birth"
        },

Results in RAML 1.0

    properties:
      dateOfBirth:
        description: Date of birth
        example: 1977-12-27
        type: date-only
        format: date
        required: false

My OAS 2.0 is automatically generated and checking the docs it looks to be perfectly valid.
https://swagger.io/specification/#dataTypes

If I import the OAS into Anypoint Design Centre, then publish to exchange, then export as RAML I get the following instead which doesn't give errors. I guess this is how the conversion should look.

            properties:
              dateOfBirth:
                description: Date of birth
                example:
                  strict: false
                  value: 1977-12-27
                type: date-only
                required: false

My expectation is that the RAML be generated without errors.

Thanks
Ben

@postatum
Copy link
Contributor

postatum commented Mar 6, 2020

Hi @benthurley82.

Thanks a lot for reporting this issue! It looks like the issue comes from our dependency lib.
I've reported the issue to that lib team.

aml-org/amf#583

@postatum postatum added amf Related to AMF issue, bug or specific behavior bug Something isn't working labels Mar 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
amf Related to AMF issue, bug or specific behavior bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants