You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.
#%RAML 1.0
title: My API
version: v1
baseUri: https://{tenant}.test.com/api/{version}/organization/{organizationId}
baseUriParameters:
tenant:
type: string
displayName: Tenant Identifier
default: yourSubDomain
organizationId:
type: UUID
displayName: ID of the Organization to interact with
default: 00000000-0000-4000-0000-000000000000
traits:
# Using Default trait to specify support for application/json, as using global mediaType for this would be overridden by Printable trait
Default:
headers:
Accept:
type: string
enum: [application/json]
default: application/json
Printable:
headers:
Accept:
type: string
enum: [application/pdf] #does this add to the enum, or does it overwrite
responses:
200:
body:
application/pdf:
resourceTypes: #Add error types, more response codes
Collection:
get:
is: [ Default ]
responses:
200:
body:
application/json:
type: <<item>>[]
Member:
get:
is: [ Default ]
responses:
200:
body:
application/json:
type: <<item>>
types:
Company:
properties:
id: string
/companies:
type: { Collection: {item: Company} }
/{id}:
type: { Member: {item: Company} }
get:
is: [ Printable ]
What this basically does is say: a GET on companies/{id} can either Accept application/json or application/pdf.
When you run this through the converter to generate OAS 3.0, only the application/pdf is properly included:
I've also tested with the same RAML file and generating HTML data from it using https://www.npmjs.com/package/raml2html and that library does parse stuff as expected, so I think my RAML is ok.
As you can see in the above example, the merging of the enum is not done according to the RAML spec
The text was updated successfully, but these errors were encountered:
p-bakker
changed the title
RAML 1.0 > OAS 3.0 not conforming to the spec when merging traints and resourceTypes
RAML 1.0 > OAS 3.0 not conforming to the spec when merging traits and resourceTypes
Aug 4, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
My RAML has something along these lines:
What this basically does is say: a GET on companies/{id} can either Accept application/json or application/pdf.
When you run this through the converter to generate OAS 3.0, only the application/pdf is properly included:
I've also tested with the same RAML file and generating HTML data from it using https://www.npmjs.com/package/raml2html and that library does parse stuff as expected, so I think my RAML is ok.
I've also Looked at the RAML specs to see how stuff in the RAML file should merge, see https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#resource-types-and-traits-effect-on-collections. I've also put the sample RAML code from the spec through the converter and the outcome is not correct:
becomes
As you can see in the above example, the merging of the enum is not done according to the RAML spec
The text was updated successfully, but these errors were encountered: