Swagger documentation for the Place/Type endpoint


#1

Hello. Would it be possible to get information about the data elements for the Place/Type endpoint: https://api.tfl.gov.uk/Place/Type/VariableMessageSign?

Specifically, in the Response schema:

  1. What are the descriptions for the data elements in the Additional Properties array, i.e.
    category, key, sourceSystemKey, value, modified.

  2. What is the length of these data elements?

  3. Are the data types correct? For example, modified is shown as being a string, but should it be a date format?

Thanks


#2

Hi @Waseem in terms of length, these are defined in C# as a string, so they could be very long, limited only be the max transfer size of the response. Whatever framework you’re using to create an API client should handle this by creating the equivalent string type on the client-side.

I’ve checked our backend database though, and none of those columns exceed 2000 chars:

  3     [Id] INT NOT NULL IDENTITY PRIMARY KEY,
  4     [PlaceId] INT NOT NULL,
  5     [Key] VARCHAR(255) NOT NULL,
  6     [Value] NVARCHAR(2000) NOT NULL,
  7     [Category] VARCHAR(255) NOT NULL,
  8     [SourceSystemKey] VARCHAR(50) NOT NULL,
  9     [Modified] DATETIME NULL DEFAULT GETUTCDATE(),

Modified on our Presentation.Entities.AdditionalProperties is defined as a nullable DateTime, this is also reflected in the response schema. It looks like our Swagger docs are describing this incorrectly as a string. We have a ticket to investigate this: SVC-4598.

In general I would recommend coding defensively against null values.

To find out what Place Categories and Types are available, visit https://api.tfl.gov.uk/Place/Meta/Categories and https://api.tfl.gov.uk/Place/Meta/PlaceTypes respectively.


#3

Thanks for the additional info Tim - I’ll also have a look at the endpoints you’ve mentioned for categories and place types.