We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using [email protected].
[email protected]
Consider the code [1]. Note that method toRamlDatatype of the parsed OAS document produces RAML which is then reported as invalid by AMF. [2]
toRamlDatatype
[1]
const amf = require('amf-client-js') const schema = JSON.stringify({ swagger: '2.0', info: {title: 'API with Types', version: ''}, paths: {}, definitions: { Thing: { $schema: 'https://json-schema.org/draft-04/schema', type: 'object', properties: { dateOfBirth: { type: 'string', format: 'date' } } } } }) async function main () { await amf.AMF.init() // Parse OAS const oasModel = await amf.AMF.oas20Parser().parseStringAsync(schema) // Validate OAS const oasReport = await amf.AMF.validate(oasModel, amf.ProfileNames.OAS20, amf.MessageStyles.OAS) console.log('OAS validation report\n', oasReport.toString()) // Generate and parse RAML const ramlStr = oasModel.declares[0].toRamlDatatype console.log('Generated RAML\n', ramlStr) const ramlModel = await amf.AMF.raml10Parser().parseStringAsync(ramlStr) // Validate RAML const ramlReport = await amf.AMF.validate(ramlModel, amf.ProfileNames.RAML10, amf.MessageStyles.RAML) console.log('RAML validation report\n', ramlReport.toString()) } main()
[2]
OAS validation report Model: http://a.ml/amf/default_document Profile: OAS 2.0 Conforms? true Number of results: 0 Generated RAML #%RAML 1.0 Library types: Thing: type: object additionalProperties: true properties: dateOfBirth: type: date-only format: date required: false RAML validation report Model: http://a.ml/amf/default_document Profile: RAML 1.0 Conforms? false Number of results: 1 Level: Violation - Source: http://a.ml/vocabularies/amf/aml#closed-shape Message: Property 'format' not supported in a RAML 1.0 shape node Level: Violation Target: http://a.ml/amf/default_document#/declarations/types/Thing/property/dateOfBirth/scalar/dateOfBirth Property: Position: Some(LexicalInformation([(9,8)-(10,0)])) Location: http://a.ml/amf/default_document
Originally reported in raml-org/webapi-parser#72.
The text was updated successfully, but these errors were encountered:
Hi @postatum. I have created an internal ticket so that the team can review it.
The internal ticket is: https://www.mulesoft.org/jira/browse/APIMF-2187
Sorry, something went wrong.
Hi @postatum! We've fixed the issue and it will be fixed in the next release: AMF 4.5.0. I'm closing this issue. Thank you!
No branches or pull requests
Using
[email protected]
.Consider the code [1]. Note that method
toRamlDatatype
of the parsed OAS document produces RAML which is then reported as invalid by AMF. [2][1]
[2]
Originally reported in raml-org/webapi-parser#72.
The text was updated successfully, but these errors were encountered: