AutoQuery Viewer and Routes - ServiceStack v5.91

According to the documentation “clicking on json link will add the .json extension to the generated url” but this is not the behavior I see on this page: https://servicestack.net/ss_admin/autoquery/QueryPageStats

I expected the generated url to be: https://servicestack.net/query/pagestats?include=Total
It’s actually https://servicestack.net/html/reply/QueryPageStats?include=Total and clicking on the links will modify the “html” part.

Possible explanation: https://servicestack.net/autoquery/metadata does not expose the routes.
For comparison: http://github.servicestack.net/autoquery/metadata

The issue, if confirmed, is definitely a minor one and ServiceStack Studio replaces the Admin UI.
However, the AutoQuery Viewer is still a useful tool and perhaps deserves a fix, if small and feasible.

It’s HTML at the start, or when you click X to reset the query:

https://servicestack.net/html/reply/QueryPageStats?include=Total

But then clicking on json sees the json link change the pre-defined route to:

https://servicestack.net/json/reply/QueryPageStats?include=Total

Which is how you change the response format for pre-defined routes.

You are right @mythz the behavior is correct in itself. But there is also a user defined route for “QueryPageStats”: https://servicestack.net/json/metadata?op=QueryPageStats

I thought the AutoQuery Viewer used it, as documented in the manual.

By the way, I noticed a possible problem while working on my project, I took your website as an example only for convenience.

The .json extension can be used to change the format for “user-defined routes”, e.g:

http://techstacks.netcore.io/ss_admin/autoquery/FindTechnologies

When no user-defined route exists, it needs to fallback to use the pre-defined route which needs to change the format by changing the pre-defined URL as above.

But in fact the “/query/pagestats” user defined route does exist, as stated before.
So I expected a bevior similar to e.g. http://github.servicestack.net/ss_admin/autoquery/QueryRepos

Nevermind @mythz The problem is elusive, I will update the topic after collecting some more information.

Below is the crucial line, this.props.selected.requestType.routes is always undefined because the routes are no longer there.

Possibly related commit: https://github.com/ServiceStack/ServiceStack/commit/cd961ecb9f3bd96b8b545036a6cc5fb8f0045b13

I’m not following you, clicking on:

http://github.servicestack.net/ss_admin/autoquery/QueryRepos

as expected lets you click on json which changes the URL to:

http://github.servicestack.net/repos.json?include=Total

Yes, that’s the expected behaviour (“X-Powered-By: ServiceStack/5.60 Net45/Windows” according to the response headers) in fact the routes are there: http://github.servicestack.net/autoquery/metadata

I quoted it to compare it with https://servicestack.net/ss_admin/autoquery/QueryPageStats (" X-Powered-By: ServiceStack/5.91 NetCore/Linux") which doesn’t behave the same way.

ok this was due to the routes metadata info being moved, I’ve re-added the routes info back to AutoQuery Metadata in the latest v5.9.1 that’s now available on MyGet.

1 Like

Great! I confirm that the problem has been solved. Thanks @mythz

1 Like