Skip to content

Add require_type_on_create? for JSON:API spec compliance (issue #164)#414

Open
Dgoz101 wants to merge 5 commits intoash-project:mainfrom
Dgoz101:main
Open

Add require_type_on_create? for JSON:API spec compliance (issue #164)#414
Dgoz101 wants to merge 5 commits intoash-project:mainfrom
Dgoz101:main

Conversation

@Dgoz101
Copy link

@Dgoz101 Dgoz101 commented Feb 25, 2026

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • [X ] I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • [X ] Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

The require-type-on-create.md has documentation that goes in depth on the compliance issue and what was done to fix it. This fixes the JSON_API spec compliance issue that allowed users to create without including a type field within the data. There is a require_type_on_create? Boolean value (set to false by default to avoid breaking existing clients) that users can set to true within their domain to enforce the compliance. When set to true, any create request whose data object omits type (or has empty type) receives a 400 response and one error object with code: "missing_type" and source_pointer: "/data".

@zachdaniel
Copy link
Contributor

This looks good to me, but no need for a whole doc about it IMO. Lets find a place to add a line or paragraph about the topic 😄

@zachdaniel
Copy link
Contributor

Also looks like some checks failing 😄

@Dgoz101
Copy link
Author

Dgoz101 commented Feb 26, 2026

Hmmm, I had them working earlier. I'll see if I can get all of that fixed.

@zachdaniel
Copy link
Contributor

@Dgoz101 please pull main, I fixed some stuff.

@Dgoz101
Copy link
Author

Dgoz101 commented Feb 27, 2026

This looks good to me, but no need for a whole doc about it IMO. Lets find a place to add a line or paragraph about the topic 😄

@zachdaniel Did you want this to be a shorter line/paragraph document or did you want the md file removed completely and adding a line about it elsewhere?

@zachdaniel
Copy link
Contributor

I think best to remove it completely and put it in the documentation for that option and/or one of the other guides.

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.

2 participants