raml-dotnet-tools icon indicating copy to clipboard operation
raml-dotnet-tools copied to clipboard

MuleSoft Clouhub RAML specifications completeness

Open IvanJosipovic opened this issue 4 years ago • 4 comments

Hi,

I'm trying to build a C# CLI for MuleSoft CloudHub APIs. The RAML is located here, RAML

After using the v3.0.0-preview to convert the RAML to a C# Client, it appears that all of the response Classes properties are blank.

Am I doing something wrong or are there issues in this RAML?

image

IvanJosipovic avatar Dec 07 '19 00:12 IvanJosipovic

Hi @IvanJosipovic, not all response classes are empty. For those you are showing there, they were generated for responses that don't specify a type. For example, for the first type on your screen capture, OrganizationGet200. The RAML in particular is this:

/organization:
  description: Organization resource
  is: [environment_based]
  get:
    description: |
      Retrieve the organization attached to the current environment.
      Requires 'Organization Admin' role.
    responses:
      200:
        body:
          application/json:
            example: !include includes/get-organization.json

As you can see, the body only specifies an example, but does not define the type. I can see in the generated code that other responses where the type was specified a type with properties was generated. But, I think for this case the right choice might be not to generate any class at all. Please let me know if generating this abstract class is a problem when trying to use the client. I think it should not, you should be able to use the RawContent on this or any other case where the type was not specified on the RAML.

woodp avatar Dec 10 '19 16:12 woodp

Thank you for the explanation. I have reached out to MuleSoft to see if they can populate the types in their RAMLs.

This library is working as expected, I am able to use the RawContent with my own models.

IvanJosipovic avatar Dec 14 '19 19:12 IvanJosipovic

I was asked to continue the question here.

I work for a company that is building hundreds of MuleSoft APIs and we're looking to automate more and more of the API provisioning process as a large part is currently manual. I was planning to build a C# Client Library to help with automating this process.

Without the types/schemas defined in the RAML, utilizing the APIs is any Strongly Typed language is very painful.

Does MuleSoft have any plans to populate the types/schemas for their CloudHub APIs?

For example: cloudhub-api-1.0.13-raml access-management-api-1.0.12-raml anypoint-mq-admin-1.0.3-raml

IvanJosipovic avatar Dec 17 '19 21:12 IvanJosipovic

I raised this topic to corresponding people at MuleSoft. Will leave the issue open for now, to follow up, but this is not related to the tool.

woodp avatar Jan 02 '20 16:01 woodp