Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.
This repository was 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

Description

@benthurley82

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    amfRelated to AMF issue, bug or specific behaviorbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions