raml-org / api-modeling-framework

DEPRECATED - This project has been moved
https://github.com/aml-org/amf
Other
27 stars 11 forks source link

AMF does not translate default type for RAML data types #69

Open sichvoge opened 7 years ago

sichvoge commented 7 years ago

In RAML data types, the default type for any types is string. For example, the following type definitions are equivalent:

types:
  AddressData:
    properties:
      address_country:
      address_locality:
      address_region:
      postal_code:
      street_address:
types:
  AddressData:
    properties:
      address_country: 
        type: string
      address_locality:
        type: string
      address_region:
        type: string
      postal_code:
        type: string
      street_address:
        type: string

AMF does not correctly correlate and assigns the default type, and only leaves the value for the type empty. This is a snippet from the JSON-LD shape:

...
      {
        "@id": "file://#/definitions/AddressData/property/address_locality",
        "@type": [
          "shacl:PropertyShape",
          "shacl:Shape"
        ],
        "raml-shapes:propertyLabel": "address_locality",
        "shacl:maxCount": 1,
        "shacl:minCount": 1,
        "shacl:path": {
          "@id": "http://raml.org/vocabularies/shapes/anon#address_locality"
        }
      }
...