JSON API - Latest posts https://discuss.jsonapi.org Latest posts What AI tools are helping you design and test APIs faster? With AI moving fast, I’m curious how people working with JSON:API or OpenAPI specs are using AI for testing or documentation.

Have you tried tools that generate tests or docs automatically from your schema?

Apidog, Scalar, and Postman AI are a few examples but wondering what’s working best for people building modern APIs.

]]>
https://discuss.jsonapi.org/t/what-ai-tools-are-helping-you-design-and-test-apis-faster/3099#post_1 Thu, 16 Oct 2025 05:10:24 +0000 discuss.jsonapi.org-post-5866
What Modern API Client Are You Using in 2025? I see a lot of devs still sticking with Postman, but with so many modern API clients around, I wonder what the community prefers.
I recently tried Apidog a newer tool combining API testing, collaboration, and documentation.
It feels fresh compared to the older giants.

Curious what everyone else is using in 2025!

]]>
https://discuss.jsonapi.org/t/what-modern-api-client-are-you-using-in-2025/3078#post_1 Tue, 29 Jul 2025 08:22:49 +0000 discuss.jsonapi.org-post-5840
Best tool/libraries for Node implementation? Hi there,

What are the best tools/libraries at the moment to implement a JSON:API server based in schema?

Merc.

]]>
https://discuss.jsonapi.org/t/best-tool-libraries-for-node-implementation/3073#post_1 Tue, 29 Jul 2025 00:11:33 +0000 discuss.jsonapi.org-post-5834
Best Postman Alternative Tools in 2025?
erika:

Hey everyone,

I’ve been using Postman for about 3 years now for API testing and documentation in our small dev team. Recently though, I’m finding it increasingly bloated and resource-heavy - my laptop fan goes crazy whenever I have it open for more than 20 minutes. Plus, since they’ve moved more features behind the paid plans, I’m wondering if it’s time to look elsewhere.

We mainly use it for REST API testing, environment management, and occasionally for documenting our APIs for the frontend team.

Has anyone switched from Postman to something else recently? What are you using, and how does it compare?

Thanks in advance!

You’re not alone – Postman’s increasing bloat and the push towards paid features are common complaints I’ve heard (and experienced myself!). It sounds like you’re at the point where the trade-offs are no longer worth it.

I’ve explored a few alternatives lately, and here are two that I think address your specific needs for REST API testing, environment management, documentation, and a lighter resource footprint:

  1. Apidog: For me, Apidog is the clear winner because it offers so much in one tool. It is secure because the code can be stored on the local machine. If you want a modern, efficient, and collaborative API tool, it’s definitely worth exploring.

  2. Hoppscotch: This is a solid, open-source option that’s designed to be lightweight and fast. It’s a web-based app (but runs nicely as a PWA), so it doesn’t consume as many system resources as a full desktop application. It handles REST APIs well, and has decent environment management features.

Key Differences:

  • Resource Consumption: Both Apidog (as a desktop app) and Hoppscotch (as a PWA) should be lighter than Postman.
  • Offline use: Apidog is design to run offline and offers great advantage to user. Hoppscotch, require internet.
  • API Documentation: Apidog is also used for API design.

Ultimately, the best way to decide is to try them out with your specific workflows and APIs. But based on your description, I think Apidog or Hoppscotch will be a good fit for you.

]]>
https://discuss.jsonapi.org/t/best-postman-alternative-tools-in-2025/3016#post_6 Mon, 21 Jul 2025 08:09:07 +0000 discuss.jsonapi.org-post-5826
Should JSON:API Include Support for Field-Level Expiry Metadata in Responses? Hello

I have been working with JSON:API for a caching-heavy application & wondered if there’s any standard / discussion around including field-level expiry metadata in JSON:API responses. :innocent:Right now, cache-control & ETags can manage whole-resource expiration but in many real-world APIs; certain attributes (like price, stock, or location) update more frequently than others. :slightly_smiling_face:

Embedding expiry metadata at the attribute level could help clients make smarter refresh / polling decisions.

I am aware this might go beyond the core spec but curious if anyone has tackled this use case. For eg; imagine a product API where the description rarely changes; but the price changes every 60 seconds sending a meta.expires_at per attribute could reduce unnecessary data fetches. :thinking:

I have not seen this discussed widely and wonder if it conflicts with the spec’s emphasis on simplicity & consistency. :innocent: Checked JSON:API — Extensions and Profiles for reference. Also checked what is cloud computing, where different data fields update at different times.

Is this something already explored through meta / extension usage in practice? Would this kind of fine-grained expiry violate the spirit of JSON:API, or could it be proposed as an optional extension? :thinking:

I would love to hear your thoughts or see if others have solved this problem differently.

Thank you !! :slightly_smiling_face:

]]>
https://discuss.jsonapi.org/t/should-json-api-include-support-for-field-level-expiry-metadata-in-responses/3065#post_1 Fri, 18 Jul 2025 04:38:54 +0000 discuss.jsonapi.org-post-5823
Are extension members allowed in resource objects? Extension can declare new members:

§ 5.4.1 Rules for Extensions

An extension MAY (…) define new object members as described below.

The specification mentions extension members explicitly at some places if there are further processing rules applied based on existing or absence extension members.

Let’s look at an example:

§ 7.1 Top Level

A document MUST contain at least one of the following top-level members:

  • data: the document’s “primary data”.
  • errors: an array of error objects.
  • meta: a meta object that contains non-standard meta-information.
  • a member defined by an applied extension.

If extension members wouldn’t be explicitly listed in this enumeration, documents having only members declared by extensions would be invalid.

]]>
https://discuss.jsonapi.org/t/are-extension-members-allowed-in-resource-objects/2788#post_2 Sun, 29 Jun 2025 18:41:16 +0000 discuss.jsonapi.org-post-5799
Naming endpoints and types for longer words This example use PascalCase for type.
Is @type and type equivalent in this case?

Organization Schema Markup | Google Search Central | Documentation | Google for Developers

“contactPoint”: {
@type”: “ContactPoint”,
“telephone”: “+9-999-999-9999”,
“email”: “[email protected]
}

its ok to have type thats not the same name as the entity in entities that have a composite relationship (if i understand it correct). for example:

“address”: [{
@type”: “PostalAddress”,
“streetAddress”: “999 W Example St Suite 99 Unit 9”,
“addressLocality”: “New York”,
“addressRegion”: “NY”,
“postalCode”: “10019”,
“addressCountry”: “US”
},{
“streetAddress”: “999 Rue due exemple”,
“addressLocality”: “Paris”,
“postalCode”: “75001”,
“addressCountry”: “FR”
}]

]]>
https://discuss.jsonapi.org/t/naming-endpoints-and-types-for-longer-words/2958#post_7 Thu, 12 Jun 2025 12:30:08 +0000 discuss.jsonapi.org-post-5793
Best Postman Alternative Tools in 2025?
marketplace.visualstudio.com

a security-first API client with built-in redaction capabilities, compliant with HIPAA, SOC2, GDPR

]]>
https://discuss.jsonapi.org/t/best-postman-alternative-tools-in-2025/3016#post_5 Thu, 29 May 2025 18:27:41 +0000 discuss.jsonapi.org-post-5787
Best Postman Alternative Tools in 2025? Great Post in Forums Brother

]]>
https://discuss.jsonapi.org/t/best-postman-alternative-tools-in-2025/3016#post_4 Sun, 25 May 2025 03:55:57 +0000 discuss.jsonapi.org-post-5782
Create/update relationships with attributes Compound documents are only valid for responses. Creating, modifing, or deleting multiple resources in a single request is not supported by the base specification. However it can be achieved using an extension. The Atomic Operations and Bulk Create extensions are two examples how that could be done.

]]>
https://discuss.jsonapi.org/t/create-update-relationships-with-attributes/1701#post_5 Fri, 09 May 2025 10:14:35 +0000 discuss.jsonapi.org-post-5772
Best way to handle nested filtering? The JSON:API specification is agnostic about filtering. It only defines that filter query parameter family should be used for it. How filtering is implemented is up to each implementation. It may be specified by a profile.

Filtering a collection based on attributes of related resources (or their existence) is a common use case. Reusing the concept of relationship paths defined by the specification for the include query parameter is a good choice in my opinion. Doing so ensures that the filtering semantics are well aligned with the rest of the specification.

I think someone should formalize that strategy as a profile at some point in time.

]]>
https://discuss.jsonapi.org/t/best-way-to-handle-nested-filtering/3027#post_2 Fri, 09 May 2025 10:06:24 +0000 discuss.jsonapi.org-post-5771
Best Practices for Connecting JSON:API to BI Tools? Hi everyone,

I’ve been working on a project that uses JSON:API to serve structured data from our backend, and it’s been great for keeping things standardized and clean. Now, my team wants to use that same data for reporting and visualization, and we’re exploring different BI tools.

One question I have is: what’s the best way to connect JSON:API-based data to platforms like Power BI? Has anyone here set up something similar? I know Power BI supports REST APIs, but I’m wondering how well it plays with JSON:API specifically.

While researching this, I also came across an article explaining Power BI architecture, and it gave me a better understanding of how data flows from source to dashboard. But I’d still love real-world input from developers who’ve connected APIs like ours to BI tools.

Are there middleware tools or patterns that help bridge this gap? I’d appreciate any guidance or examples!

Thanks in advance,
J Mathew

]]>
https://discuss.jsonapi.org/t/best-practices-for-connecting-json-api-to-bi-tools/3031#post_1 Fri, 09 May 2025 06:54:59 +0000 discuss.jsonapi.org-post-5770
How to validate the JSON API format I’ve been using the JSON API schema from jsonapi.org to validate my responses. Tools like JSONLint and Assertible are quite helpful for this. They assist in ensuring that the structure aligns with the JSON API specifications. However, I’ve noticed that some edge cases require manual checks, especially when dealing with complex relationships.

]]>
https://discuss.jsonapi.org/t/how-to-validate-the-json-api-format/147#post_9 Thu, 08 May 2025 09:00:32 +0000 discuss.jsonapi.org-post-5769
Simplifying JSON Validation: Best Practices and Tools for Ensuring Data Integrity I’ve found using AJV (Another JSON Schema Validator) really helpful for simplifying JSON validation. It supports JSON Schema validation and is fast, which is great for large payloads. I also like combining it with Zod for stricter runtime checks, especially when you need more flexibility beyond just schema validation. It keeps the data integrity tight without too much boilerplate.

]]>
https://discuss.jsonapi.org/t/simplifying-json-validation-best-practices-and-tools-for-ensuring-data-integrity/3018#post_2 Wed, 07 May 2025 05:45:30 +0000 discuss.jsonapi.org-post-5768
Issue with Pagination in JSON:API
Hey everyone, I’ve been using Postman for about 3 years now for API testing and documentation in our small dev team. Recently though, I’m finding it increasingly bloated and resource-heavy - my laptop fan goes crazy whenever I have it open for more than 20 minutes. Plus, since they’ve moved more features behind the paid plans, I’m wondering if it’s time to look elsewhere. We mainly use it for REST API testing, environment management, and occasionally for documenting our APIs for the frontend t…
]]>
https://discuss.jsonapi.org/t/issue-with-pagination-in-json-api/3024#post_2 Tue, 06 May 2025 04:18:24 +0000 discuss.jsonapi.org-post-5767
Best way to handle nested filtering? Hi everyone,
I’m building an API using JSON:API spec and I’m a bit stuck on how to properly implement filtering on a nested relationship (e.g., /articles?filter[comments.author.name]=John).
Is this kind of deep filtering considered valid, or should it be handled differently?

Appreciate any advice!

]]>
https://discuss.jsonapi.org/t/best-way-to-handle-nested-filtering/3027#post_1 Mon, 05 May 2025 10:47:28 +0000 discuss.jsonapi.org-post-5763
Issue with Pagination in JSON:API Hi all,

I’m trying to implement pagination in my JSON:API response, but I’m having trouble with the “next” and “previous” links. They aren’t showing up as expected, even though I’m following the pagination guidelines. I’m using version 1.0.0 of the specification. Has anyone run into this issue or have any tips on how to fix it?

Thanks in advance for any advice!

]]>
https://discuss.jsonapi.org/t/issue-with-pagination-in-json-api/3024#post_1 Fri, 02 May 2025 06:59:25 +0000 discuss.jsonapi.org-post-5760
Simplifying JSON Validation: Best Practices and Tools for Ensuring Data Integrity As developers, we often rely on JSON Schema to ensure the consistency and validity of our JSON data. However, validating complex schemas and debugging errors can sometimes be challenging. This discussion aims to explore how we can simplify JSON validation processes while improving efficiency and reliability.

Key Questions for Discussion:

What are the most common challenges you face when validating JSON data?

How do you approach debugging validation errors in complex schemas?

Are there specific features or tools you wish existed to make JSON validation easier?

Why This Matters:
JSON validation is critical for ensuring data integrity, especially in large-scale systems where data exchange happens across multiple platforms. By sharing best practices and discussing innovative tools, we can collectively improve the development experience and reduce errors.

A New Resource in the Community:
This new website offers a streamlined approach to validating JSON data against schemas. It seems like a promising addition to the tools available for developers working with JSON. Have any of you tried it yet? If so, what are your thoughts on its features or usability?

Feel free to share your experiences, ideas, or even examples of tools or techniques that have worked well for you. Let’s collaborate to make JSON validation simpler and more effective for everyone!

01

]]>
https://discuss.jsonapi.org/t/simplifying-json-validation-best-practices-and-tools-for-ensuring-data-integrity/3018#post_1 Wed, 02 Apr 2025 09:18:25 +0000 discuss.jsonapi.org-post-5754
How to validate the JSON API format While there are tons of tools around the web, I recently came across this absolutely new JSON-Validate website.

Do try this out … Have been using it for a while now!

]]>
https://discuss.jsonapi.org/t/how-to-validate-the-json-api-format/147#post_8 Wed, 02 Apr 2025 09:13:24 +0000 discuss.jsonapi.org-post-5753
Best Postman Alternative Tools in 2025? I recently faced similar challenges with Postman and after evaluating several alternatives, our team migrated to Apidog about 6 months ago - it’s been a significant improvement for our workflow.

Apidog offers a comprehensive solution that covers API design, debugging, testing, and documentation in a more resource-efficient package. Guess you can have a try!

]]>
https://discuss.jsonapi.org/t/best-postman-alternative-tools-in-2025/3016#post_2 Wed, 02 Apr 2025 03:39:21 +0000 discuss.jsonapi.org-post-5751
Best Postman Alternative Tools in 2025? Hey everyone,

I’ve been using Postman for about 3 years now for API testing and documentation in our small dev team. Recently though, I’m finding it increasingly bloated and resource-heavy - my laptop fan goes crazy whenever I have it open for more than 20 minutes. Plus, since they’ve moved more features behind the paid plans, I’m wondering if it’s time to look elsewhere.

We mainly use it for REST API testing, environment management, and occasionally for documenting our APIs for the frontend team.

Has anyone switched from Postman to something else recently? What are you using, and how does it compare?

Thanks in advance!

]]>
https://discuss.jsonapi.org/t/best-postman-alternative-tools-in-2025/3016#post_1 Wed, 02 Apr 2025 03:38:32 +0000 discuss.jsonapi.org-post-5750
Does the client have to know the server’s id for gets and patches? I’m not fully sure if I got your question. Maybe it helps if I elaborate on resource’s IDs a little bit. Feel free to ask follow-up questions.

Every resource has an ID. The ID is identifying the resource together with the resource’s type.

The ID is immutable. It’s set by the client or server when creating the resource. IDs generated by the client are discussed in 9.1.1 Client-Generated IDs.

The local identifier (lid) allow to identify resources within a JSON:API document which don’t have an ID yet. This is the case for creating resources if using server-generated IDs.

]]>
https://discuss.jsonapi.org/t/does-the-client-have-to-know-the-server-s-id-for-gets-and-patches/3008#post_2 Wed, 12 Mar 2025 18:56:36 +0000 discuss.jsonapi.org-post-5742
Does the client have to know the server’s id for gets and patches? Hi
If I understand the standard correctly then the id is always the id of the resource on the server?

Or can it be the id on the client?

What I’d really like to do is allow the client to send its own identifier for the resource in all calls and have the server use that (and a client identifier) to uniquely identify the resource on the server?

Is that totally going against the spec? I see it is possible in a post by using lid, but that for a get or patch the client must provide the id?

Thanks

Dave

]]>
https://discuss.jsonapi.org/t/does-the-client-have-to-know-the-server-s-id-for-gets-and-patches/3008#post_1 Sun, 09 Mar 2025 14:54:12 +0000 discuss.jsonapi.org-post-5741
Best Practices for Implementing JSON I’m one of those people who has only used the page[number] page[size] implementation and that is or was a thing our frontend developers hated. What I mean by hated is the links object with first, last, and so on values, so instead we added headers also to include a count of all records, current page, next page and so on.

On thing to take note of is that the json specifications are open to most kinds of pagination


and if the implementation the team did (that i worked in) would have been done only with the json api specifications then we would probably had included a meta object in the links object like the discussion in Pagination controls.

]]>
https://discuss.jsonapi.org/t/best-practices-for-implementing-json/2991#post_2 Wed, 05 Feb 2025 17:38:44 +0000 discuss.jsonapi.org-post-5723
Best Practices for Implementing JSON Hello

When working with large datasets; implementing efficient pagination is crucial for performance and usability. JSON:API provides guidelines for pagination, but there are multiple approaches, such as page-based, offset-based, and cursor-based pagination. What are the best practices for implementing pagination while maintaining compliance with JSON:API standards? :upside_down_face:

One challenge developers face is balancing performance with usability. For example, cursor-based pagination is more efficient for large datasets but can be complex to implement. On the other hand; offset-based pagination is simpler but may become slow with large data tables. How do you determine the best approach for your specific use case? :thinking: I have checked https://jsonlint.com/mastering-json-format- Salesforce Developer documentation guide for reference.

I’d love to hear insights from those; who have implemented pagination in JSON:API. What challenges did you encounter, and how did you resolve them? Are there recommended libraries / techniques that simplify pagination while ensuring consistency with JSON:API specifications? :thinking:

Thank you ! :slightly_smiling_face:

]]>
https://discuss.jsonapi.org/t/best-practices-for-implementing-json/2991#post_1 Fri, 31 Jan 2025 16:39:35 +0000 discuss.jsonapi.org-post-5722
Create/update relationships with attributes I believe there’s nothing forbidding the client to use the included top-level member. Would you agree the following is valid?

{
    "data": {
        "type": "carts",
        "attributes": {
            "note": "Some note about cart",
        },
        "relationships": {
            "products": [
                "data": {
                    "type": "products",
                    "lid": "some-uuid"
                }
            ]
        }
    },
    "included": [
        {
            "type": "products",
            "lid": "some-uuid",
            "attributes": {
                "quantity": 5
            }
        }
    ]
}
]]>
https://discuss.jsonapi.org/t/create-update-relationships-with-attributes/1701#post_4 Sat, 21 Dec 2024 00:21:29 +0000 discuss.jsonapi.org-post-5715
Naming endpoints and types for longer words Maybe this is more correct?
json:api recommends:

endpoint name: /v2/schoolUnits/{school-unit-code}
response:

{
“data”: {
“type”: “schoolUnits”,
“id”: “1”,
“attributes”: {
// … this schoolunit’s attributes
},
“relationships”: {
// … this schoolunit’s relationships
}
}
}

other examples of type: address becomes addresses, email to emails, phoneNumber to phoneNumbers, enrolment to enrolments and person to persons (or people?).

]]>
https://discuss.jsonapi.org/t/naming-endpoints-and-types-for-longer-words/2958#post_6 Wed, 27 Nov 2024 17:15:29 +0000 discuss.jsonapi.org-post-5703
Status of Versioning - What's the silver bullet? I prefer the Accept header method but version 1.1 of the spec (intentionally or not) prohibits it.

Under 6.3 Server Responsibilites it says:

If all instances of that media type are modified with a media type parameter other than ext or profile , servers MUST respond with a 406 Not Acceptable status code.

In other words, including anything other than ext= or profile= in the content type is prohibited.

So while I fully agree it should not be part of the specification I don’t think the spec should prohibit versioning methods either but it does actually prevent versioning via content negotiation.

I’m trying to figure this out myself currently as well and I’m leaning towards an X-API-Version header because I don’t like there being more than one URI that identifies the same resource.

]]>
https://discuss.jsonapi.org/t/status-of-versioning-whats-the-silver-bullet/1150#post_3 Fri, 15 Nov 2024 20:59:28 +0000 discuss.jsonapi.org-post-5694
Naming endpoints and types for longer words I know microsoft lika camelCase but all other seems to use hyphens :grinning:.
For example Zalando
Example paths:

/shopping-carts/{country}/{session-id}
/shopping-carts/{country}/{session-id}/items/{item-id}
/api-specifications/{docker-image-id}/apis/{path}/{file-name}
/api-specifications/{repository-name}/{artifact-name}:{tag}
/article-size-advices/{sku}/{sales-channel}

https://opensource.zalando.com/restful-api-guidelines/

The standard best practice for REST APIs is to have a hyphen, not camelcase or underscores. This comes from Mark Masse’s “REST API Design Rulebook” from Oreilly.

It is recommended to use the spinal-case (which is highlighted by RFC3986), this case is used by Google, PayPal, and other big companies.

Microsoft says: DO use kebab-casing (preferred) or camel-casing for URL path segments. If the segment refers to a JSON field, use camel casing.
api-guidelines/azure/Guidelines.md at vNext · microsoft/api-guidelines · GitHub

Seems to me that Microsoft recommends kebab-casing in this case (my case) since Im referring to a value in a field/attribute (type) and not to a JSON field??

Hyphens and camelcase as value in the type field (attribute) feels weird but I guess it has to be same as the URI to be consistent :thinking: Or use best of both worlds (combination).

If I understand it correct most (almost all) would recommend this solution:

endpoint name: /v2/school-units/{school-unit-code}
response:

{
“data”: {
“type”: “school-units”,
“id”: “1”,
“attributes”: {
// … this schoolunit’s attributes
},
“relationships”: {
// … this schoolunit’s relationships
}
}
}

json:api recommends:

endpoint name: /v2/schoolUnit/{school-unit-code}
response:

{
“data”: {
“type”: “schoolUnit”,
“id”: “1”,
“attributes”: {
// … this schoolunit’s attributes
},
“relationships”: {
// … this schoolunit’s relationships
}
}
}

best of both worlds:

endpoint name: /articles/1 HTTP/1.1
{
“data”: {
“type”: “article”,
“id”: “1”,
“attributes”: {
// … this article’s attributes
},
“relationships”: {
// … this article’s relationships
}
}
}

endpoint name: /v2/school-units/{school-unit-code}
response:

{
“data”: {
“type”: “schoolUnit”,
“id”: “1”,
“attributes”: {
// … this schoolunit’s attributes
},
“relationships”: {
// … this schoolunit’s relationships
}
}
}

I will have to think about whether we should follow json:api and use camelCase in the uri and value in attribute type or make an exception in this case since most standards recommends hyphens (URL is case sensitive, its good for SEO to use hyphens and so on).

]]>
https://discuss.jsonapi.org/t/naming-endpoints-and-types-for-longer-words/2958#post_5 Wed, 06 Nov 2024 10:13:41 +0000 discuss.jsonapi.org-post-5683
Naming endpoints and types for longer words JSON:API recommends camelCase also for URLs implicitly. The relevant statements are:

It is recommended that the URL for a collection of resources be formed from the resource type.

It is recommended that a relationship URL be formed by appending /relationships/ and the name of the relationship to the resource’s URL.

In both cases it does not mention to transform the resource type or name of the relationship from camelCase to kebab-case or snake_case.

Microsoft Graph REST API is one example among many which use camelCase in URLs for REST APIs.

]]>
https://discuss.jsonapi.org/t/naming-endpoints-and-types-for-longer-words/2958#post_4 Wed, 06 Nov 2024 09:44:46 +0000 discuss.jsonapi.org-post-5682
Naming endpoints and types for longer words Hi!

Thank you for your answer.
So the solution for our endpointname is: /v2/schoolUnits/{school-unit-code} ?
Are you sure the rule applies on URLs for Resource Collections? I know camelCase is standard for attributes but I have never seen an endpoint with camelcase. Not in any blog (best practise), forum or source (like Fielding).
Some examples I could find: Use Plural Nouns for Collections Dont: Avoid CamelCase or Underscores.
Use hyphens (-) to improve the readability of URIs.
To make your URIs easy for people to scan and interpret, use the hyphen (-) character to improve the readability of names in long-path segments
http://api.example.com/devicemanagement/manageddevices/
http://api.example.com/device-management/managed-devices /This is much better version/

What value should I use in attribute type in the response if I use above example.

Im still not convinced if the json:api standard recommends camelCase.
I want to apply the json api standard but I cant find any good source with examples with plural nouns for a resource/type with wordword.

Do you have any other source that recommends using camelCase in endpoints (and type)?

TIA!
Best regards

]]>
https://discuss.jsonapi.org/t/naming-endpoints-and-types-for-longer-words/2958#post_3 Wed, 06 Nov 2024 08:53:27 +0000 discuss.jsonapi.org-post-5681
Naming endpoints and types for longer words JSON:API specification recommends camelCase: schoolUnits

Please find details about naming recommendation here: JSON:API — Recommendations

]]>
https://discuss.jsonapi.org/t/naming-endpoints-and-types-for-longer-words/2958#post_2 Tue, 05 Nov 2024 05:20:35 +0000 discuss.jsonapi.org-post-5680
Naming endpoints and types for longer words As i understand ut json:api has nouns in plural for naming endpoint and type.
For example endpoint “articles” have type “articles”.

What is a good naming convention on endpoints and type for for words (nouns) that consist of two words for example SchoolUnit?

endpoint name: /v2/school-units/{school-unit-code}
response:

{
“data”: {
“type”: “schoolunit”,
“id”: “1”,
“attributes”: {
// … this article’s attributes
},
“relationships”: {
// … this article’s relationships
}
}
}

Thank you!

]]>
https://discuss.jsonapi.org/t/naming-endpoints-and-types-for-longer-words/2958#post_1 Wed, 30 Oct 2024 15:38:26 +0000 discuss.jsonapi.org-post-5679
POST and required fields Thanks, that’s how I saw things. It was just the use of the word “MAY” in that context seemed to imply that we should support a POST request without “content”.
Makes sense, of course, that this is an implementation specific requirement.

]]>
https://discuss.jsonapi.org/t/post-and-required-fields/2941#post_5 Mon, 14 Oct 2024 08:32:02 +0000 discuss.jsonapi.org-post-5665
POST and required fields
skaaptjop:

I was wondering about the definition of “MAY” in this case, meaning can we actually require the attributes member to be present?

Yes. You can enforce the attributes member to be present implicitly by requiring a specific attribute to be present. I think in practice that’s the most common use case by far. Allowing a resource to be created without enforcing any attribute to be set is an edge case.

Having the attributes member as optional allows clients and servers to avoid unnecessary characters. Instead of having an empty object as value of the attributes member, they can skip the attributes member entirely.

]]>
https://discuss.jsonapi.org/t/post-and-required-fields/2941#post_4 Thu, 10 Oct 2024 09:09:28 +0000 discuss.jsonapi.org-post-5661
POST and required fields Thanks jelhan,
I’m actually looking at the whole ‘attributes’ member in the ‘data’ object.
I realise that fields inside the ‘attributes’ object are up to us to define but the specification says that a resource object MAY contain an attributes member.

This seems to imply that one should support the creation of resources (via a POST) where the ‘attributes’ member is not supplied at all, like:

...
data: {
  type: 'mytype'
  # no attributes: {...}
}

I was wondering about the definition of “MAY” in this case, meaning can we actually require the attributes member to be present?

]]>
https://discuss.jsonapi.org/t/post-and-required-fields/2941#post_3 Thu, 10 Oct 2024 08:29:44 +0000 discuss.jsonapi.org-post-5660
POST and required fields The server can enforce additional constraints on the resources typically discussed as validation. E.g. it can enforce some attributes to exist in requests to create a resource.

]]>
https://discuss.jsonapi.org/t/post-and-required-fields/2941#post_2 Sun, 06 Oct 2024 13:36:54 +0000 discuss.jsonapi.org-post-5659
POST and required fields Hi,
Would love to hear thoughts or clarification on something possibly quite simple.

For creating a resource (POST) the spec (9.1) says:

The request MUST include a single resource object as primary data. The resource object MUST contain at least a type member.

Then in 7.2:

In addition, a resource object MAY contain any of these top-level members:

So my question is quite simply should we handle scenarios where a POST request does not include attributes (or meta) in the resource object? Essentially this would be a POST to create a resource where no resource attribute fields was given (only ‘type’) and the created resources would use whatever defaults are defined. This might not make sense for specific resources.

Or, can we interpret the MAY statement to be that we may require attributes to be provided?

]]>
https://discuss.jsonapi.org/t/post-and-required-fields/2941#post_1 Fri, 04 Oct 2024 06:58:46 +0000 discuss.jsonapi.org-post-5655
Atomic extension missing constraints Well, that really complicates handling those requests. Because presentation layer just make modifications of business entity and then translate those entities to presentation entity, ergo resource. Making snapshots of business entity is really overhead.

I think this is inconvenient even more if you consider constraint about included data, which tells to include resource only once, even if there are multiple resource identificators. So I have algorithm which checks data to ensure there is resource in full only once. Now even this must be optional.

Anyway thanks for your answers and ideas, I’m gonna try push further with my solution and come back with some production feedback.

P.s. And don’t get me wrong, I’m not here to gripe. I’m very grateful for all your work and effort. Me and my team love the idea of batch operations which atomic try to bring. That’s why I’m so prudent about it. I just want it to works.

]]>
https://discuss.jsonapi.org/t/atomic-extension-missing-constraints/2931#post_7 Sun, 22 Sep 2024 14:52:38 +0000 discuss.jsonapi.org-post-5648
Atomic extension missing constraints I just noticed that the atomic operations extension allows targeting the same resource in multiple operations explicitly. An operation object may “target an individual resource that has been assigned a local identity (lid) in a prior operation object.”

]]>
https://discuss.jsonapi.org/t/atomic-extension-missing-constraints/2931#post_6 Sun, 22 Sep 2024 12:09:32 +0000 discuss.jsonapi.org-post-5647
Atomic extension missing constraints
Bednic:

What should be a response in that case?

The atomic operations extension defines the data member of a result object as “the “primary data” resulting from the operation.” So it should be the state of the resource after that specific operation. Not the state of the resource after performing all operations. At least in my reading.

I see that this may complicate client implementations. Those may need to calculate the state of the object after performing all operations.

]]>
https://discuss.jsonapi.org/t/atomic-extension-missing-constraints/2931#post_5 Sun, 22 Sep 2024 12:05:45 +0000 discuss.jsonapi.org-post-5646
Atomic extension missing constraints Accept it or not isn’t the problem. What should be a response in that case? Have to take a snapshots of resource for each operation to satisfy atomicity? Or is it fine just return final state of resource for both operations? This leads to another question. Is it right to have same resource in atomic: results twice or more times?

]]>
https://discuss.jsonapi.org/t/atomic-extension-missing-constraints/2931#post_4 Sat, 21 Sep 2024 21:57:19 +0000 discuss.jsonapi.org-post-5645
Atomic extension missing constraints @jelhan My thoughts on the case are that it is generally fine to accept it, although ultimately it is up to the server whether to do so or not.

]]>
https://discuss.jsonapi.org/t/atomic-extension-missing-constraints/2931#post_3 Sat, 21 Sep 2024 18:06:28 +0000 discuss.jsonapi.org-post-5644
Atomic extension missing constraints
Bednic:
  • Is it right that this extension forbids some part of base specification, like data?

Yes. The data and included members are forbidden if atomic operations extension is applied.

Great question!

A server cannot support the include query parameter if the atomic operations extension is applied. If the include query parameter is applied, the included member must be present in the response document. But that’s forbidden by the extension. Supporting the include query parameter would lead to conflicting processing rules.

The same applies to sort query parameter. The base specification requires that primary data in data member must be sorted as requested. But that conflicts with processing rules of the extension which forbids that member.

For sorting, pagination and filtering it does not seem that clearly defined. But I think the intention of the base specification is clearly that those apply to the primary data encoded in data. A server should not support those query parameters if atomic extension operation is applied.

I think this should be clarified in the extension.

I’m not sure on sparse fieldset to be honest. Applying it to the data within an atomic response object seem to make sense. And I don’t see a processing rule within the base spec conflicting with that.

That’s a very good question as well. I fear that case hasn’t been considered when defining the extension. My first intention would be that a server should reject a request if it targets the same resource twice. But that may not prevent the issue entirely. A request could still update a resource and the resource relationships in a same request. And there might be even valid use cases for it. E.g. updating a resource’s attribute and patching a to-many relationship of the same resource in a single request. @dgeb what’s your thoughts on that case?

Assuming that the API follows the recommended URL naming schema: yes.

]]>
https://discuss.jsonapi.org/t/atomic-extension-missing-constraints/2931#post_2 Thu, 19 Sep 2024 20:40:23 +0000 discuss.jsonapi.org-post-5643
Atomic extension missing constraints Hello there,

I’m currently working on integration of atomic extension and I’m missing some guidelines in specification.

  1. Is it right that this extension forbids some part of base specification, like data?
  2. What happens to other parts of request like pagination, inclusion, sort, sparse fields etc. Is it forbidden too?
  3. What to do when there are two operations for same resource? Because specification says it must return result for atomic operation, which means I should return resource object in several stages of update if multiple update operations occurs in one request?
  4. Is Ref and URI Path interchangeable? e.g. i have path /authors/123/relationships/comments, which means there is resource type authors, id 123 and relationship comments, is it same as ref with type: authors, id: 123 and relationship: comments?

Thanks for even partial answers. This really bothers my mind nowadays.

]]>
https://discuss.jsonapi.org/t/atomic-extension-missing-constraints/2931#post_1 Thu, 12 Sep 2024 19:39:37 +0000 discuss.jsonapi.org-post-5635
Example of lid usage Intended lid usage is not well described in the specification yet. We have a pending ticket for adding a note clarify that: Explain intent of local identifiers in a note in the spec · Issue #1740 · json-api/json-api · GitHub

Please find more information on it in this topic in the meantime: How are local IDs supposed to be used?

]]>
https://discuss.jsonapi.org/t/example-of-lid-usage/2929#post_2 Thu, 12 Sep 2024 15:15:57 +0000 discuss.jsonapi.org-post-5633
Example of lid usage Hi there!

Is somewhere example usage of lid identifier? I cannot imagine use-case where lid can somehow appear in document and be useful. The only scenario which comes to my mind is when two different resource types are created. Like creating new order and new order-item then i can use lid as intended. But that is not possible in JSON:API. Creating resource is possible only one by one. So even if client want create multiple resource, it must call server for each individually, so even there isn’t lid necessary (for pairing purpose).

Second thing about lid is, if I understand it correctly, I have to return client-provided lid with newly created resource? Like I have tu remember that string through whole creating process and then add it to resource? Isn’t it a little bit heavy? Especially when on server lid does not carry any useful linking information as described before.

]]>
https://discuss.jsonapi.org/t/example-of-lid-usage/2929#post_1 Mon, 09 Sep 2024 21:43:33 +0000 discuss.jsonapi.org-post-5632
JSON Schema Link Broken Thank you so much. This is very helpful.

]]>
https://discuss.jsonapi.org/t/json-schema-link-broken/2924#post_3 Sun, 08 Sep 2024 02:52:33 +0000 discuss.jsonapi.org-post-5626
JSON Schema Link Broken This one is from project github

or if you want to see the original one which somehow disappears, here it is

]]>
https://discuss.jsonapi.org/t/json-schema-link-broken/2924#post_2 Sat, 07 Sep 2024 21:05:13 +0000 discuss.jsonapi.org-post-5625
JSON Schema Link Broken There’s a document linked on the FAQ for a json schema document that describes JSON:API. The link, however, is broken.

FAQ: JSON:API — Frequently Asked Questions
Link: https://jsonapi.org/schema

I searched around for awhile and came up empty. I’m hoping someone knows where I can find a copy.

Having this document would be very helpful in implementing a JSON:API server. Thanks for your time.

]]>
https://discuss.jsonapi.org/t/json-schema-link-broken/2924#post_1 Fri, 06 Sep 2024 19:58:25 +0000 discuss.jsonapi.org-post-5624