Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with inherit objects in raml (calling one object inside the datatype) #12

Open
mcheguini opened this issue Nov 4, 2021 · 0 comments

Comments

@mcheguini
Copy link
Contributor

mcheguini commented Nov 4, 2021

Hi @StefH
I hope you are doing well,
I found out RamlToOpenApiConvert is not able to process inherit objects, this scenario is presented in follow
Following code can be use for testing:

#%RAML 1.0
title: My API with Types
mediaType: application/json
types:
  Email:
    type: object
    properties:
      subject: string
      body: emailbody
  emailbody:
    type: object
    properties:
      maintext: string 
      footer: string
      id: integer
/getemail:
  get:
    responses:
      200:
        body:
          application/json:
            type: Email

image
after little bit research I found out following line is missing in OpenApi (json) file body

          "body": {
            "$ref": "#/components/schemas/emailbody"
          }

after adding the mentioned line into the json file I got the expected result
image

Another use case can bee using !include, when I am using the following code to referencing the object inside the other object in raml, following line in missing inside the OpenAPI json file:

"$ref": "#/components/schemas/Emails"

json file
image

Raml files are attached for your review
Test_Object.zip

@mcheguini mcheguini changed the title Problem with referencing the object with items in raml Problem with nested objects in raml (calling one object inside the datatype) Nov 4, 2021
@mcheguini mcheguini changed the title Problem with nested objects in raml (calling one object inside the datatype) Problem with inherit objects in raml (calling one object inside the datatype) Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant