baseUriParameters vs root uriParameters


#1

Reading the spec I am left wondering when to use baseUriParameters versus a root uriParameters. The spec gives examples of both without explaining why either one was chosen.

It gives this example of baseUriParameters

#%RAML 0.8
title: Amazon S3 REST API
version: 1
baseUri: https://{bucketName}.s3.amazonaws.com
baseUriParameters:
  bucketName:
    description: The name of the bucket

It gives this example of a root uriParameters

#%RAML 0.8
title: Salesforce Chatter Communities REST API
version: v28.0
baseUri: https://{communityDomain}.force.com/{communityPath}
uriParameters:
 communityDomain:
   displayName: Community Domain
   type: string
 communityPath:
   displayName: Community Path
   type: string
   pattern: ^[a-zA-Z0-9][-a-zA-Z0-9]*$
   minLength: 1

Why is the second example using uriParameters instead of baseUriParameters when its describing variables in the baseUri?


#2

Hi @elevy, you found a typo in that example of the spec.

That property should have been baseUriParameters. The RAML parser in the API-designer/console would reject that RAML.


#3

Need me to open a ticket somewhere? Github?


#4

Bueller? Bueller?

Note that this is not just a typo in the example. That section on root properties is named “URI Parameters” not “Base URI Parameters”. The whole section uses uriParameters instead of baseUriParameters when discussing the property.