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

Invalid conversion result when converting RAML 1.0 with multiple examples to OAS 2 #38

Open
mduesterhoeft opened this issue Jun 13, 2018 · 0 comments

Comments

@mduesterhoeft
Copy link

mduesterhoeft commented Jun 13, 2018

I have a RAML 1.0 file with multiple examples. The functional specification says that only one example will be kept because OpenApi Specification only supports one example.

This is my RAML fragment:

/{shippingZoneId}/shipping-methods/{shippingMethodId}:
  get:
    description: null
    responses:
      200:
        body:
          application/hal+json:
            type: !include 'shipping-zones-shipping-method-get-schema-response-merged.json'
            examples:
              shipping-zones-shipping-method-get-with-weight-based-price: !include 'shipping-zones-shipping-method-get-with-weight-based-price-response.json'
              shipping-zones-shipping-method-get: !include 'shipping-zones-shipping-method-get-response.json'

This is the output - it is having the example name and also carries all the examples:

 "/shipping-zones/{shippingZoneId}/shipping-methods/{shippingMethodId}": {
      "get": {
        "operationId": "GET_shipping-zones-shippingZoneId-shipping-methods-shippingMethodId",
        "produces": [
          "application/hal+json"
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "example": {
                "shipping-zones-shipping-method-get-with-weight-based-price": {
                  "name": "Standard Shipping 1",
                  "description": "Standard Shipping",
                  "taxClass": "REGULAR",
                  "position": 0,
                  "freeShippingValue": null,
                  "fixedPrice": {
                    "taxModel": "GROSS",
                    "currency": "EUR",
                    "amount": 16.95
                  },
                  "weightBasedPrice": null,
                  "_id": "8ed01c04-6fc2-47f7-985b-f6855ca6f17b",
                  "_links": {
                    "self": {
                      "href": "https://yourshop.api.urn/shipping-zones/b24b7049-79f0-4758-aa90-49bb78a95cb6/shipping-methods/8ed01c04-6fc2-47f7-985b-f6855ca6f17b"
                    }
                  }
                },
                "shipping-zones-shipping-method-get": {
                  "name": "Standard Shipping 2",
                  "description": "Standard Shipping",
                  "taxClass": "REGULAR",
                  "position": 0,
                  "freeShippingValue": {
                    "currency": "EUR",
                    "amount": 400
                  },
                  "fixedPrice": {
                    "taxModel": "GROSS",
                    "currency": "EUR",
                    "amount": 19.99
                  },
                  "weightBasedPrice": null,
                  "_id": "b7b58df1-c493-4ec6-8fe4-783877a0f14c",
                  "_links": {
                    "self": {
                      "href": "https://yourshop.api.urn/shipping-zones/390a3013-ca74-4f0b-8c29-9b0a34facfd7/shipping-methods/b7b58df1-c493-4ec6-8fe4-783877a0f14c"
                    }
                  }
                }
              },
              "type": "object"
            }
          }
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