jpie 3.10.0 → 3.10.1.pre.202608310314

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 637098cfaf33f60d61c1669573a007686467f5218a1b20aff8701886b3fa79d5
4
- data.tar.gz: 95e995bb47caddc5f3ae867b0e4d3aa2b5fb2de9f40225bba36a7edb527b62b0
3
+ metadata.gz: 7d7b7930d242f1cb28bae23269e93bf730e4bc30bfdcc10c951936a8a077dc8f
4
+ data.tar.gz: b03c030bea6499e3857aaa243c1f616f9382dcb2d36a55447c696c9d2e5bf398
5
5
  SHA512:
6
- metadata.gz: ccbdca591a2dcd1a6745f72beb4f477777ac96bfbbf0f3973c56bb4d2f7e63ebecc4bd20feab45d345e887a4d2903aa97c2bce3efa30a36f26403d771311d3fb
7
- data.tar.gz: 3a6f363d40e998ce65c9805ed06fcf7a2fea1b5e2aac13fd14360f0b8250937b9a00302b230e2a2931d32b8991e55ffdfd93c779cc3534f54f7ed06a1e0755bf
6
+ metadata.gz: 866881fe03f8816b4a3ed08b4ff962e17b2551717912d81a7902c01907c4f7a3f7fb1c69d2281cfd1c2ecc3ca363cc4f6293b99bf97900d41a106cedb9944d0e
7
+ data.tar.gz: 138eea7549a9cf59006fdc2df0e8a481cc5d2776a98bdfe3da8b4b740b0a5ae9e3d964b420cb1e5c8f6bcf5a5a9c45a933e69e9b8edd0991dd641ffd33f6a764
data/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ This project follows [semantic versioning](https://semver.org/spec/v2.0.0.html).
4
+
5
+ Add your entry under "Unreleased". Klaay staff move it into a version section
6
+ at release time.
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - Open-source documents: `LICENSE`, `NOTICE`, `CONTRIBUTING.md`,
13
+ `CODE_OF_CONDUCT.md`, `SECURITY.md`, `TRADEMARK.md`, `CLA.md`,
14
+ `THIRD_PARTY_LICENSES.md`, and this changelog.
15
+ - GitHub issue templates, a pull request template, a Dependabot config, and a
16
+ CLA Assistant workflow.
17
+
18
+ ## [3.10.0]
19
+
20
+ ### Fixed
21
+
22
+ - Resolve the create definition with the request namespace.
23
+ - Give a member route the same include preloads as a collection.
24
+ - Run an attachment sideload through the authorization hook.
25
+
26
+ ## Earlier releases
27
+
28
+ Releases before 3.10.0 predate this file. Read their history in the git tags
29
+ and in the [GitHub releases](https://github.com/klaayinc/json_api/releases).
30
+
31
+ [Unreleased]: https://github.com/klaayinc/json_api/compare/v3.10.0...HEAD
32
+ [3.10.0]: https://github.com/klaayinc/json_api/compare/v3.9.0...v3.10.0
data/CLA.md ADDED
@@ -0,0 +1,122 @@
1
+ # JPie Individual Contributor License Agreement ("Agreement") v1.0
2
+
3
+ > This Agreement adapts the Apache Software Foundation Individual Contributor
4
+ > License Agreement V2.2 for Klaay ApS. The intellectual-property terms are the
5
+ > Apache text, unchanged. Klaay ApS is the counterparty. The data handling in the
6
+ > final section follows Klaay's privacy policy.
7
+
8
+ Thank you for your interest in JPie. To clarify the intellectual property
9
+ license granted with Contributions from any person or entity, Klaay ApS (the
10
+ "Company"), a company registered in Denmark, must have on file a signed
11
+ Contributor License Agreement ("CLA") from each Contributor, indicating agreement
12
+ with the license terms below. This agreement is for your protection as a
13
+ Contributor as well as the protection of the Company and the users of the Work.
14
+ It does not change your rights to use your own Contributions for any other
15
+ purpose.
16
+
17
+ You do not email this Agreement. When you open your first pull request, the CLA
18
+ Assistant bot posts a link and records your agreement against your GitHub
19
+ account. For questions, contact legal@klaay.com.
20
+
21
+ You accept and agree to the following terms and conditions for Your
22
+ Contributions (present and future) that you submit to the Company. Except for
23
+ the license granted herein to the Company and recipients of software distributed
24
+ by the Company, You reserve all right, title, and interest in and to Your
25
+ Contributions.
26
+
27
+ 1. Definitions.
28
+
29
+ "You" (or "Your") shall mean the copyright owner or legal entity authorized
30
+ by the copyright owner that is making this Agreement with the Company. For
31
+ legal entities, the entity making a Contribution and all other entities that
32
+ control, are controlled by, or are under common control with that entity are
33
+ considered to be a single Contributor. For the purposes of this definition,
34
+ "control" means (i) the power, direct or indirect, to cause the direction or
35
+ management of such entity, whether by contract or otherwise, or (ii)
36
+ ownership of fifty percent (50%) or more of the outstanding shares, or (iii)
37
+ beneficial ownership of such entity.
38
+
39
+ "Contribution" shall mean any original work of authorship, including any
40
+ modifications or additions to an existing work, that is intentionally
41
+ submitted by You to the Company for inclusion in, or documentation of, any of
42
+ the products owned or managed by the Company (the "Work"). For the purposes
43
+ of this definition, "submitted" means any form of electronic, verbal, or
44
+ written communication sent to the Company or its representatives, including
45
+ but not limited to communication on electronic mailing lists, source code
46
+ control systems, and issue tracking systems that are managed by, or on behalf
47
+ of, the Company for the purpose of discussing and improving the Work, but
48
+ excluding communication that is conspicuously marked or otherwise designated
49
+ in writing by You as "Not a Contribution."
50
+
51
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
52
+ Agreement, You hereby grant to the Company and to recipients of software
53
+ distributed by the Company a perpetual, worldwide, non-exclusive, no-charge,
54
+ royalty-free, irrevocable copyright license to reproduce, prepare derivative
55
+ works of, publicly display, publicly perform, sublicense, and distribute Your
56
+ Contributions and such derivative works.
57
+
58
+ > This grant lets the Company distribute Your Contributions under the
59
+ > project's MIT license and under other license terms. Klaay ApS
60
+ > uses this right to keep the option of a commercial or dual license of the
61
+ > combined Work.
62
+
63
+ 3. Grant of Patent License. Subject to the terms and conditions of this
64
+ Agreement, You hereby grant to the Company and to recipients of software
65
+ distributed by the Company a perpetual, worldwide, non-exclusive, no-charge,
66
+ royalty-free, irrevocable (except as stated in this section) patent license
67
+ to make, have made, use, offer to sell, sell, import, and otherwise transfer
68
+ the Work, where such license applies only to those patent claims licensable
69
+ by You that are necessarily infringed by Your Contribution(s) alone or by
70
+ combination of Your Contribution(s) with the Work to which such
71
+ Contribution(s) was submitted. If any entity institutes patent litigation
72
+ against You or any other entity (including a cross-claim or counterclaim in a
73
+ lawsuit) alleging that your Contribution, or the Work to which you have
74
+ contributed, constitutes direct or contributory patent infringement, then any
75
+ patent licenses granted to that entity under this Agreement for that
76
+ Contribution or Work shall terminate as of the date such litigation is filed.
77
+
78
+ 4. You represent that you are legally entitled to grant the above license. If
79
+ your employer(s) has rights to intellectual property that you create that
80
+ includes your Contributions, you represent that you have received permission
81
+ to make Contributions on behalf of that employer, that your employer has
82
+ waived such rights for your Contributions to the Company, or that your
83
+ employer has executed a separate Corporate CLA with the Company.
84
+
85
+ 5. You represent that each of Your Contributions is Your original creation (see
86
+ section 7 for submissions on behalf of others). You represent that Your
87
+ Contribution submissions include complete details of any third-party license
88
+ or other restriction (including, but not limited to, related patents and
89
+ trademarks) of which you are personally aware and which are associated with
90
+ any part of Your Contributions.
91
+
92
+ 6. You are not expected to provide support for Your Contributions, except to the
93
+ extent You desire to provide support. You may provide support for free, for a
94
+ fee, or not at all. Unless required by applicable law or agreed to in writing,
95
+ You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR
96
+ CONDITIONS OF ANY KIND, either express or implied, including, without
97
+ limitation, any warranties or conditions of TITLE, NONINFRINGEMENT,
98
+ MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
99
+
100
+ 7. Should You wish to submit work that is not Your original creation, You may
101
+ submit it to the Company separately from any Contribution, identifying the
102
+ complete details of its source and of any license or other restriction
103
+ (including, but not limited to, related patents, trademarks, and license
104
+ agreements) of which you are personally aware, and conspicuously marking the
105
+ work as "Submitted on behalf of a third-party: [named here]".
106
+
107
+ 8. You agree to notify the Company of any facts or circumstances of which you
108
+ become aware that would make these representations inaccurate in any respect.
109
+
110
+ ## Governing law and personal data
111
+
112
+ This Agreement is governed by the laws of Denmark, without regard to its
113
+ conflict-of-law rules. The Danish courts have exclusive jurisdiction over any
114
+ dispute that arises from it.
115
+
116
+ Klaay ApS is the data controller for the personal data in this Agreement. To
117
+ record and manage your agreement, Klaay ApS stores your name, your email address,
118
+ and your GitHub username, on the lawful basis of its legitimate interest in
119
+ establishing the license to Your Contributions. Klaay ApS keeps this record for
120
+ as long as the Work uses Your Contributions. Klaay's privacy policy at
121
+ https://klaay.com/privacy-policy describes your rights and how to exercise them.
122
+ For data questions, contact privacy@klaay.com.
@@ -0,0 +1,83 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ * Trolling, insulting or derogatory comments, and personal or political attacks
23
+ * Public or private harassment
24
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at security@klaay.com. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
+
43
+ ## Enforcement Guidelines
44
+
45
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
+
47
+ ### 1. Correction
48
+
49
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
+
51
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
+
53
+ ### 2. Warning
54
+
55
+ **Community Impact**: A violation through a single incident or series of actions.
56
+
57
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
+
59
+ ### 3. Temporary Ban
60
+
61
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
+
63
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
+
65
+ ### 4. Permanent Ban
66
+
67
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
+
69
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
70
+
71
+ ## Attribution
72
+
73
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74
+
75
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76
+
77
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78
+
79
+ [homepage]: https://www.contributor-covenant.org
80
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81
+ [Mozilla CoC]: https://github.com/mozilla/diversity
82
+ [FAQ]: https://www.contributor-covenant.org/faq
83
+ [translations]: https://www.contributor-covenant.org/translations
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,164 @@
1
+ # Contributing to JPie
2
+
3
+ Thank you for your interest in JPie. This guide explains how to build the gem,
4
+ how to send a change, and the standards a change must meet.
5
+
6
+ ## License and the CLA
7
+
8
+ JPie is licensed under the MIT License. When you open your first pull request,
9
+ the CLA Assistant bot asks you to sign the
10
+ [Contributor License Agreement](CLA.md). Sign it once. The bot records your
11
+ agreement against your GitHub account and marks later pull requests as covered.
12
+
13
+ The CLA lets Klaay distribute your change under the project license and keep
14
+ the option of a commercial license of the combined work. You keep the copyright
15
+ to your contribution.
16
+
17
+ ## Ways to contribute
18
+
19
+ - Report a bug. Open an issue with the bug report template.
20
+ - Request a feature. Open an issue with the feature request template.
21
+ - Send a fix or a feature. Open a pull request from your fork.
22
+ - Improve the documentation. The same pull request flow applies.
23
+
24
+ For a large change, open an issue first and agree on the approach. This saves
25
+ you from a rewrite after review.
26
+
27
+ ## Set up the repository
28
+
29
+ You need Ruby 3.4 or later. Install the dependencies:
30
+
31
+ ```bash
32
+ bin/setup
33
+ ```
34
+
35
+ Open a console with the gem loaded:
36
+
37
+ ```bash
38
+ bin/console
39
+ ```
40
+
41
+ ## Run the tests
42
+
43
+ The suite runs against a dummy Rails application in `spec/dummy`. It needs no
44
+ external database; it uses SQLite.
45
+
46
+ ```bash
47
+ bundle exec rspec
48
+ ```
49
+
50
+ Run one file:
51
+
52
+ ```bash
53
+ bundle exec rspec spec/requests/regression/authorization_scope_show_bypass_spec.rb
54
+ ```
55
+
56
+ ## Run the benchmarks
57
+
58
+ The benchmark suite measures query counts and memory for large `include` trees:
59
+
60
+ ```bash
61
+ rake benchmark
62
+ ```
63
+
64
+ It writes `tmp/request_benchmark_results.json`. Compare that file against
65
+ [PERFORMANCE_BASELINE.md](PERFORMANCE_BASELINE.md) after any change to
66
+ serialization or preloading. Set `DEBUG_QUERIES=1` to dump the raw SQL logs.
67
+
68
+ ## Before you open a pull request
69
+
70
+ Run the same checks that CI runs. All must pass:
71
+
72
+ ```bash
73
+ bundle exec rspec
74
+ bundle exec rubocop
75
+ ```
76
+
77
+ Do not silence a check to make it pass. Never add a `rubocop:disable` comment,
78
+ and never change `.rubocop.yml` to hide an offense. Correct the code instead.
79
+
80
+ ## Write the test first
81
+
82
+ JPie follows test-driven development. A change starts with a failing test:
83
+
84
+ 1. Write the test at the highest level the change allows. Prefer a request spec
85
+ in `spec/requests` over a unit spec.
86
+ 2. Run it and watch it fail.
87
+ 3. Write the smallest code that makes it pass.
88
+ 4. Refactor with the test green.
89
+
90
+ A bug fix needs a regression spec in `spec/requests/regression/`. The spec must
91
+ fail before the fix and pass after it.
92
+
93
+ ## Pull request standards
94
+
95
+ - Keep each commit small, logical, and able to be reverted on its own.
96
+ - Write a clear commit message. State what the commit does and why.
97
+ - Add tests for a fix or a feature.
98
+ - Keep the pull request focused. Do not mix unrelated changes.
99
+ - Update `README.md` when you change or add a public behavior.
100
+ - Add an entry to `CHANGELOG.md` under "Unreleased".
101
+ - Never commit a token, a password, or a real account identifier.
102
+
103
+ ## Public API and versions
104
+
105
+ JPie follows semantic versioning. Treat these as the public API:
106
+
107
+ - The `jsonapi_resources` routing DSL.
108
+ - The `JSONAPI::Resource` class methods and their options.
109
+ - `JSONAPI::Configuration` and its settings.
110
+ - The controller behavior and the response documents.
111
+ - The test helpers in `JSONAPI::Testing`.
112
+
113
+ Anything under `JSONAPI::Support` is internal. It may change in a patch
114
+ release. State in your pull request when a change breaks the public API.
115
+
116
+ ## How a change gets merged
117
+
118
+ Klaay staff merge to `main`. Branch protection requires a passing CI run and a
119
+ review from a maintainer. Open your pull request from a fork; the CI job runs
120
+ on it automatically.
121
+
122
+ Klaay staff cut releases. Do not bump `lib/json_api/version.rb` in a pull
123
+ request.
124
+
125
+ ## Writing standard for prose
126
+
127
+ All prose in this repository — documentation, code comments, commit messages,
128
+ and pull request text — follows ASD-STE100 (Simplified Technical English) and
129
+ George Orwell's six rules of writing.
130
+
131
+ ASD-STE100:
132
+
133
+ - Use only approved words. One word, one meaning. Technical names and technical
134
+ verbs of this domain are permitted.
135
+ - Write in the active voice. Use the present tense where possible.
136
+ - Keep sentences short. Use a maximum of 20 words in an instruction and 25
137
+ words in descriptive text.
138
+ - Give one instruction per sentence. Start an instruction with the command form
139
+ of the verb.
140
+ - Do not make noun clusters of more than three nouns.
141
+ - Do not use slang, idioms, or Latin abbreviations.
142
+ - Use a vertical list when you give more than three facts or steps in sequence.
143
+ - Start a warning or a caution with the command, not the explanation.
144
+
145
+ Orwell's six rules:
146
+
147
+ 1. Never use a metaphor, simile, or other figure of speech which you are used
148
+ to seeing in print.
149
+ 2. Never use a long word where a short one will do.
150
+ 3. If it is possible to cut a word out, always cut it out.
151
+ 4. Never use the passive where you can use the active.
152
+ 5. Never use a foreign phrase, a scientific word, or a jargon word if you can
153
+ think of an everyday English equivalent.
154
+ 6. Break any of these rules sooner than say anything outright barbarous.
155
+
156
+ ## Code of conduct
157
+
158
+ This project follows the [Contributor Covenant](CODE_OF_CONDUCT.md). By taking
159
+ part, you agree to uphold it. Report unacceptable behavior to security@klaay.com.
160
+
161
+ ## Security
162
+
163
+ Do not report a security problem in a public issue. Follow the private process
164
+ in [SECURITY.md](SECURITY.md).
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Klaay ApS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/NOTICE ADDED
@@ -0,0 +1,25 @@
1
+ JPie
2
+ Copyright (c) 2026 Klaay ApS
3
+
4
+ This gem is free software. You may use it under the terms of the MIT License.
5
+ See the LICENSE file for the full text.
6
+
7
+ ------------------------------------------------------------------------------
8
+ Third-party software
9
+ ------------------------------------------------------------------------------
10
+
11
+ Runtime dependencies
12
+ JPie depends on four gems at runtime: rails, actionpack, pg_query, and
13
+ prosopite. Their licenses are MIT, BSD-3-Clause, and Apache-2.0. The full
14
+ list is in THIRD_PARTY_LICENSES.md. Every one is compatible with the MIT
15
+ license of this gem.
16
+
17
+ JPie bundles no third-party code. Bundler resolves and installs each
18
+ dependency from rubygems.org.
19
+
20
+ ------------------------------------------------------------------------------
21
+ Trademarks
22
+ ------------------------------------------------------------------------------
23
+
24
+ JPie, Klaay, and the Klaay logo are trademarks of Klaay ApS. The MIT license
25
+ grants no rights to use these marks. See TRADEMARK.md.
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # JPie
2
2
 
3
+ <img width="300" height="300" alt="ChatGPT Image Aug 30, 2026, 03_23_31 PM" src="https://github.com/user-attachments/assets/6f63901c-5415-4a7a-b359-dfa4a6b91e14" />
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/jpie.svg)](https://rubygems.org/gems/jpie)
6
+ [![CI](https://github.com/klaayinc/json_api/actions/workflows/ci.yml/badge.svg)](https://github.com/klaayinc/json_api/actions/workflows/ci.yml)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
+
3
9
  A Rails 8+ gem that provides JSON:API compliant routing DSL and generic JSON:API controllers for producing and consuming JSON:API resources.
4
10
 
5
11
  ## Features
@@ -1768,7 +1774,7 @@ For polymorphic relationships, omit the `type` in the model definition and provi
1768
1774
  ```typescript
1769
1775
  // Model definition - no type constraint
1770
1776
  api.define(
1771
- "workstream",
1777
+ "activity",
1772
1778
  {
1773
1779
  topic: {},
1774
1780
  subject: {
@@ -1777,15 +1783,15 @@ api.define(
1777
1783
  },
1778
1784
  },
1779
1785
  {
1780
- collectionPath: "workstreams",
1786
+ collectionPath: "activities",
1781
1787
  },
1782
1788
  );
1783
1789
 
1784
1790
  // Create with polymorphic relationship
1785
- const { data: workstream } = await api
1786
- .create("workstream", {
1791
+ const { data: activity } = await api
1792
+ .create("activity", {
1787
1793
  topic: "edit",
1788
- subject: { id: "456", type: "vendors" }, // Provide type at runtime
1794
+ subject: { id: "456", type: "posts" }, // Provide type at runtime
1789
1795
  })
1790
1796
  .toPromise();
1791
1797
  ```
@@ -1831,10 +1837,51 @@ try {
1831
1837
  3. **Content-Type header**: Must be `application/vnd.api+json` for POST/PATCH/PUT requests
1832
1838
  4. **Filter values**: Comma-separated filter values are parsed as a single string; use array notation for multiple values
1833
1839
 
1840
+ ## Releases
1841
+
1842
+ Two paths publish the gem to rubygems.org:
1843
+
1844
+ - **Real release**: run `bin/release [major|minor|patch]` on a branch. The
1845
+ script bumps `lib/json_api/version.rb` and commits. Open a PR. When the bump
1846
+ lands on main, the `Release` workflow publishes the gem and pushes the
1847
+ `v<version>` tag. No OTP code is needed.
1848
+ - **Nightly prerelease**: the `Nightly prerelease` workflow runs each night at
1849
+ 03:00 UTC. When main has commits that no release or nightly covers, it
1850
+ publishes `<next-patch>.pre.<stamp>` (for example `3.10.1.pre.202608300300`).
1851
+ Bundler ignores prerelease versions unless a Gemfile asks for one, so
1852
+ consumers on a normal pin never see them. The workflow moves the `nightly`
1853
+ git tag to the published commit; `bin/nightly` computes the version and never
1854
+ commits it.
1855
+
1856
+ Both workflows authenticate with [trusted publishing](https://guides.rubygems.org/trusted-publishing/),
1857
+ so no API key or OTP code is stored anywhere. Set it up once on rubygems.org:
1858
+ open the jpie gem → Trusted publishers → add two GitHub Actions publishers for
1859
+ repository `klaayinc/json_api`, one with workflow `nightly.yml` and one with
1860
+ workflow `release.yml`.
1861
+
1834
1862
  ## Contributing
1835
1863
 
1836
- Bug reports and pull requests are welcome on GitHub at https://github.com/klaay/json_api.
1864
+ Bug reports and pull requests are welcome. Read
1865
+ [CONTRIBUTING.md](CONTRIBUTING.md) before you open one. It covers the test
1866
+ suite, the writing standard, and the pull request checklist.
1867
+
1868
+ - Report a bug or request a feature in the
1869
+ [issue tracker](https://github.com/klaayinc/json_api/issues).
1870
+ - Sign the [Contributor License Agreement](CLA.md). The bot asks on your first
1871
+ pull request.
1872
+ - Follow the [Code of Conduct](CODE_OF_CONDUCT.md).
1873
+
1874
+ ## Security
1875
+
1876
+ Do not report a security problem in a public issue. Send it to
1877
+ security@klaay.com. Read [SECURITY.md](SECURITY.md) for the process.
1837
1878
 
1838
1879
  ## License
1839
1880
 
1840
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
1881
+ JPie is free software under the [MIT License](LICENSE).
1882
+
1883
+ Copyright (c) 2026 Klaay ApS.
1884
+
1885
+ The dependency licenses are in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
1886
+ The license grants no rights to the JPie and Klaay names or logos. Read
1887
+ [TRADEMARK.md](TRADEMARK.md).
data/SECURITY.md ADDED
@@ -0,0 +1,49 @@
1
+ # Security Policy
2
+
3
+ ## Report a vulnerability
4
+
5
+ Do not open a public issue for a security problem. Public disclosure puts users
6
+ at risk before a fix exists.
7
+
8
+ Send the report by email to **security@klaay.com**. Include:
9
+
10
+ - A description of the problem.
11
+ - The steps to reproduce it.
12
+ - The JPie version and the Rails version you tested.
13
+ - A minimal resource, route, or request that shows the problem.
14
+
15
+ You may encrypt the report. Ask for a key at the same address.
16
+
17
+ ## What happens next
18
+
19
+ - Klaay confirms receipt within three working days.
20
+ - Klaay investigates and agrees a fix timeline with you.
21
+ - Klaay credits you in the release notes, unless you ask to stay anonymous.
22
+
23
+ Please give Klaay a reasonable time to release a fix before you disclose the
24
+ problem in public.
25
+
26
+ ## Supported versions
27
+
28
+ Klaay fixes security problems in the latest minor release. Upgrade to the
29
+ latest version before you report a problem.
30
+
31
+ ## Scope
32
+
33
+ This policy covers the JPie gem in this repository. It does not cover an
34
+ application that uses JPie, and it does not cover the Klaay backend service.
35
+ Report a backend problem to the same address, and Klaay routes it to the right
36
+ team.
37
+
38
+ ## What counts as a JPie vulnerability
39
+
40
+ JPie serializes and deserializes data that an application exposes. A report
41
+ that matters most describes one of these:
42
+
43
+ - A request that reads a record the authorization scope excludes.
44
+ - A request that writes an attribute or a relationship the resource does not
45
+ declare as writable.
46
+ - A filter, sort, or include value that reaches the database unchecked.
47
+ - A response that leaks an attribute outside the declared fields.
48
+
49
+ Never paste production data, a token, or a customer identifier into a report.
@@ -0,0 +1,27 @@
1
+ # Third-party licenses
2
+
3
+ JPie bundles no third-party code. It declares the four runtime dependencies
4
+ below. Bundler installs them from rubygems.org when a user installs the gem.
5
+ Every license is compatible with the MIT license in `LICENSE`.
6
+
7
+ | Gem | Version | License |
8
+ |---|---|---|
9
+ | actionpack | 8.1.1 | MIT |
10
+ | pg_query | 6.2.2 | BSD-3-Clause |
11
+ | prosopite | 2.1.2 | Apache-2.0 |
12
+ | rails | 8.1.1 | MIT |
13
+
14
+ The versions are the ones in `Gemfile.lock`. A user resolves their own
15
+ versions inside the range that `jpie.gemspec` declares.
16
+
17
+ Regenerate this table after any dependency change:
18
+
19
+ ```bash
20
+ bin/third-party-licenses
21
+ ```
22
+
23
+ ## Development dependencies
24
+
25
+ The gems in the `development, test` group of the `Gemfile` do not ship with
26
+ JPie. They build and test the gem. They place no license obligation on a user
27
+ of the published gem.
data/TRADEMARK.md ADDED
@@ -0,0 +1,35 @@
1
+ # Trademark Policy
2
+
3
+ The JPie source code is free software under the MIT License. The names and the
4
+ logos are not part of that license.
5
+
6
+ ## Reserved marks
7
+
8
+ "JPie", "Klaay", and the Klaay logo are trademarks of Klaay ApS. The MIT
9
+ License grants you rights to the code. It grants you no rights to these marks.
10
+
11
+ ## What you may do
12
+
13
+ - Use the names to refer to this project truthfully. For example, state that
14
+ your application "uses JPie" or "is built on JPie".
15
+ - Keep the names and the notices intact when you redistribute the gem
16
+ unchanged.
17
+
18
+ ## What you may not do
19
+
20
+ - Do not use the names or the logo for a modified version in a way that
21
+ suggests Klaay makes it or endorses it.
22
+ - Do not use the names or the logo for your product, your company, or your
23
+ domain name.
24
+ - Do not publish a gem whose name suggests that Klaay maintains it.
25
+ - Do not change or remove the marks to pass the software off as your own.
26
+
27
+ ## Modified versions
28
+
29
+ You may fork and modify the code. The MIT License gives you this freedom. If
30
+ you publish a modified gem, give it a different name and remove the Klaay logo,
31
+ so users do not confuse it with the official gem.
32
+
33
+ ## Questions
34
+
35
+ Ask about trademark use at legal@klaay.com.