Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make requests schema agnostic #1

Open
amercader opened this issue Jan 27, 2016 · 1 comment
Open

Make requests schema agnostic #1

amercader opened this issue Jan 27, 2016 · 1 comment

Comments

@amercader
Copy link

As you very well state on the README the results returned by different instances will depend on their own custom schemas.

I'm not sure what API calls you use internally but you can force calls to package_show to always return the default internal CKAN schema passing the use_default_schema=True parameter.

So instead of this:

http://ckan.data.ktn.gv.at/api/3/action/package_show?id=abflusswerte-karnten

you get this:

http://ckan.data.ktn.gv.at/api/3/action/package_show?id=abflusswerte-karnten&use_default_schema=True

Note that custom fields like lineage or update_frequency are now located in extras which is the way CKAN stores them internally. You will get the same behaviour across all CKAN sites and versions (starting from CKAN 2.2, which is when support for this parameter was introduced)

The same behaviour should be available to package_search, but sadly there's a bug that raises an exception when passing the use_default_schema parameter. I've submitted a patch for it that will be backported to older versions: ckan/ckan#2848

Hope this helps

@wilhelmberg
Copy link
Collaborator

you can force calls to package_show to always return the default internal CKAN schema passing the use_default_schema=True parameter.

Nice! Good to know.
Must have missed this in the API docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants