Skip to content

Conversation

jasonkarns
Copy link
Contributor

@jasonkarns jasonkarns commented Nov 1, 2022

Rationale: the jsonapi_* helpers for GET/POST/PUT/PATCH/DELETE each accept a url. In many api specs, the url can be derived from the ActiveRecord record(s) that are created before-hand. This allows the specs to pass the AR records to the jsonapi_* helpers directly and have the URL derived from the model the same way that Rails derives its routing for a given AR model instance.

that allows make_request subjects like:
jsonapi_get order, jsonapi_put user, jsonapi_delete card and for index: jsonapi_get products_path

Initial slack discussion: https://graphiti-api.slack.com/archives/C5A4UEMGS/p1658959255745979

The url_for helper still accepts a regular string, so it should be backwards compatible with existing usage.

@jkeen jkeen merged commit c5e4b23 into graphiti-api:master Mar 18, 2025
github-actions bot pushed a commit that referenced this pull request Mar 18, 2025
# 1.0.0 (2025-03-18)

### Bug Fixes

* allow current_user and params to remain lazy in rspec contexts ([#25](#25)) ([6ce1e07](6ce1e07))
* jsonapi_included helper may accept symbol keys ([#20](#20)) ([cc3cb2d](cc3cb2d))
* require rspec-core as a dependency of the matchers ([0ea2a92](0ea2a92))

### Features

* alias Node#key? to Node#has_key? ([#24](#24)) ([202aecb](202aecb))
* Allow passing AR records to jsonapi_* http operations ([#22](#22)) ([c5e4b23](c5e4b23))
* Support matching against RSpec's`include` builtin ([#23](#23)) ([1ed6fd0](1ed6fd0))
github-actions bot pushed a commit that referenced this pull request Mar 18, 2025
# [1.2.0](v1.1.0...v1.2.0) (2025-03-18)

### Bug Fixes

* allow current_user and params to remain lazy in rspec contexts ([#25](#25)) ([6ce1e07](6ce1e07))
* jsonapi_included helper may accept symbol keys ([#20](#20)) ([cc3cb2d](cc3cb2d))
* require rspec-core as a dependency of the matchers ([0ea2a92](0ea2a92))

### Features

* alias Node#key? to Node#has_key? ([#24](#24)) ([202aecb](202aecb))
* Allow passing AR records to jsonapi_* http operations ([#22](#22)) ([c5e4b23](c5e4b23))
* Support matching against RSpec's`include` builtin ([#23](#23)) ([1ed6fd0](1ed6fd0))
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants