Skip to content

fix(create): send schema with resource_create - #28

Open
luccasmmg wants to merge 1 commit into
mainfrom
fix/create-resource-with-schema
Open

luccasmmg wants to merge 1 commit into
mainfrom
fix/create-resource-with-schema

Conversation

@luccasmmg

Copy link
Copy Markdown
Member

Problem

datastore_create with a new resource dict and ingestion_mode: upsert always fails with CKAN denied resource_create.

The service creates the CKAN resource without a schema and only adds it afterwards via resource_patch. ckanext-neso validates upsert resources at create time and rejects them when schema.primaryKey is missing, so the create never gets that far.

Fix

Include the schema the service already built in the resource_create call. The post-write sync is unchanged; it patches the same schema, so aircan's upsert type-change guard doesn't fire.

Reproduced on dev (api.dev.neso.energy) during UAT. A resource created with the same typed schema passes both CKAN checks there, and the upsert flow works end to end.

CKAN may validate the schema when the resource is created: ckanext-neso
rejects an upsert resource without schema.primaryKey. The schema was only
added by the post-write resource_patch, so datastore_create with a new
upsert resource always failed with 'CKAN denied resource_create'.
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 59839673-97f2-4bd0-b212-a10d820280f8
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant