aggregates do first :last_bid_price, :bids, :price do sort inserted_at: :desc end end
aggregates do first :last_bid_price, :bids, :price do sort inserted_at: :desc end end
If I add json api for that resource like this:
json_api do type "property" routes do base "/property" index :read end end
json_api do type "property" routes do base "/property" index :read end end
If I try to get that resource with
curl 'localhost:4000/api/markets/property'
curl 'localhost:4000/api/markets/property'
I will get this error:
[error] #PID<0.811.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.810.0>, stream id 1) terminatedServer: localhost:4000 (http)Request: GET /api/markets/property** (exit) an exception was raised: ** (MatchError) no match of right hand side value: {:error, "Must provide field type for first"} (ash_json_api 0.31.1) lib/ash_json_api/json_schema/json_schema.ex:506: anonymous fn/2 in AshJsonApi.JsonSchema.filter_props/1...
[error] #PID<0.811.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.810.0>, stream id 1) terminatedServer: localhost:4000 (http)Request: GET /api/markets/property** (exit) an exception was raised: ** (MatchError) no match of right hand side value: {:error, "Must provide field type for first"} (ash_json_api 0.31.1) lib/ash_json_api/json_schema/json_schema.ex:506: anonymous fn/2 in AshJsonApi.JsonSchema.filter_props/1...
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.