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

Ignored RAML issue: Missing required documentation properties #349

Closed
postatum opened this issue Apr 4, 2019 · 2 comments
Closed

Ignored RAML issue: Missing required documentation properties #349

postatum opened this issue Apr 4, 2019 · 2 comments
Labels
internal issue Internal issue created to track this case

Comments

@postatum
Copy link
Contributor

postatum commented Apr 4, 2019

Issue

Running code below with each of the RAML inputs provided should fail or report validation error because according to RAML 1.0 spec provided RAML inputs are invalid.

The spec says:

title ... Its value MUST be a non-empty string.
content ... Its value MUST be a non-empty string and MAY be formatted using markdown.

Spec link:
https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#user-documentation

amf-client-js version

3.1.9

RAML Inputs

#%RAML 1.0
title: ZEncoder API
documentation:
 - title:
   content:
#%RAML 1.0
title: ZEncoder API
documentation:
 - title: Welcome
   content:
#%RAML 1.0
title: ZEncoder API
documentation:
 - title:
   content: |
     Welcome to the _Zencoder API_ Documentation.

JavaScript Code

const amf = require('amf-client-js')

const ramlStr = ''  // Pick one of the above RAML inputs

async function main () {
  await amf.AMF.init()
  const model = await amf.AMF.raml10Parser().parseStringAsync(ramlStr)
  let report
  try {
    report = await amf.AMF.validate(
      model, amf.ProfileNames.RAML10, amf.MessageStyles.RAML)
  } catch (e) {
    console.log(e.toString())
  }
  if (!report.conforms) {
    report.results.map(res => {
      console.log(`${res.level} - ${res.message}`)
    })
  }
}

main()
@tomsfernandez
Copy link
Contributor

Hi @postatum. I have reproduced this in AMF's latest version and will be creating an internal ticket to keep track of this problem issue.

We will provide further updates in this Github issue thread.

Internal ticket: https://www.mulesoft.org/jira/browse/APIMF-2174

@bulju bulju transferred this issue from another repository Jul 3, 2020
@nschejtman nschejtman added the internal issue Internal issue created to track this case label Jul 7, 2020
@arielmirra
Copy link
Contributor

This issue has been fixed in this PR and will be available in our next release (September 23th 2020)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal issue Internal issue created to track this case
Projects
None yet
Development

No branches or pull requests

4 participants