Model Metadata ?

Hi,


XData docs says one could query 'model metadata' througt /$model

When trying to use it I get only an error:

        "code": "UrlInfoError",
        "message": "Unknown path "$model""

Why is that? 

OTOH, if you issue a GET on the 'root url' you get back a list of all entities available.

How to prevent that?

Have you compiled your XData server with the very latest version? Such $model path was introduced in version 2.8.

To avoid returning something in the root url, you could use a middleware to return a 404 not found for such URL:




  Module.AddMiddleware(TAnonymousMiddleware.Create(
    procedure(Context: THttpServerContext; Next: THttpServerProc)
    begin
      if Length(Module.GetRelativeSegments(Context.Request.Uri)) = 0 then
        Context.Response.StatusCode := 404
      else
        Next(Context);
    end
  )
  );


My bad. Sorry. I'm using previus version.


Nice! Thanks again Wagner.