Boggin
Boggin

Reputation: 3414

RAML API baseUriParameters unused template parameter error

I want to create a different base URI for each of the dozen customers of my API so the endpoints are the same but I can filter on customer. I think adding a template parameter to the base URI is the solution but how do I use the baseUriParameter?

I've imported a RAML spec into APIMATIC that has a baseUriParameter.

baseUri: http://{fi}.api.mycompany.com
baseUriParameters:
  fi:
    type: string

This template parameter gets added to each endpoint as a parameter. Here's an example endpoint.

/users:
  get:

This gives an error message.

"Endpoint Users has an unused template parameter named fi."

APIMATIC has a parameter added to the endpoint. APIMATIC Edit Parameter

It also means no test cases have been auto-generated.

How do I use the baseUriParameter?

Upvotes: 0

Views: 434

Answers (1)

m3h
m3h

Reputation: 261

Try importing your RAML API description file again. APIMATIC will use your baseUri and create template parameters now. You can checkout the Server Configuration page to see what parameters in the baseUri were recognized and set the default values for them as well.

enter image description here

Reference documentation for Server Configuration and template parameters in baseUri: https://docs.apimatic.io/api-editor/server-configuration/

Hope this helps!

Upvotes: 1

Related Questions