Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 7 additions & 6 deletions .claude/skills/scalar-ruby-sdk/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
name: scalar-ruby-sdk
description: "Ruby SDK for Scalar API. Use when writing Ruby code that calls Scalar API with the scalar-api-ruby package: installing it, constructing and authenticating the client, and calling API operations."
description: "Ruby SDK for Scalar API. Use when writing Ruby code that calls Scalar API with the scalar_api_ruby package: installing it, constructing and authenticating the client, and calling API operations."
---

# Scalar Ruby SDK

Generated Ruby client for Scalar API, published as `scalar-api-ruby`. Use the generated client instead of hand-writing HTTP requests.
Generated Ruby client for Scalar API, published as `scalar_api_ruby`. Use the generated client instead of hand-writing HTTP requests.

## Install

Add the gem to your application's `Gemfile`:

```ruby
gem "scalar-api-ruby", "~> 0.1.1" # x-release-please-version
gem "scalar_api_ruby", "~> 0.2.0" # x-release-please-version
```

Or install it directly:

```sh
gem install scalar-api-ruby
gem install scalar_api_ruby
```

## Client setup and authentication

```ruby
require "scalar-api-ruby"
require "scalar_api_ruby"

client = Scalar::Client.new(
bearer_auth: ENV["BEARER_AUTH"], # defaults to the BEARER_AUTH env var
Expand All @@ -34,11 +34,12 @@ client = Scalar::Client.new(
Provide credentials using the options below. Environment variables are read automatically when the target runtime supports them:

- `bearer_auth` (env: `BEARER_AUTH`) — Credential for the BearerAuth authentication scheme.
- `o_auth2` (env: `SCALAR_OAUTH_TOKEN`) — Authorization code with PKCE (S256), for apps acting on behalf of a Scalar user. Each scope implies the weaker ones.

## Calling operations

```ruby
require "scalar-api-ruby"
require "scalar_api_ruby"

client = Scalar::Client.new(
bearer_auth: ENV["BEARER_AUTH"], # defaults to the BEARER_AUTH env var
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.1"
".": "0.2.0"
}
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
# Changelog

## [0.2.0](https://github.com/scalar/scalar-ruby/compare/v0.1.1...v0.2.0) (2026-10-09)


### ⚠ BREAKING CHANGES

* **api:** Schema `method` changed from `enum(delete | get | head | …)` to `string`.
* **api:** Configuration of `oauth2` auth scheme `OAuth2` changed.
* **api:** 10 breaking changes to the SDK surface.
- Removed operation `oAuth.oauthAuthorize` (`GET /v1/oauth/authorize`).
- Removed operation `oAuth.oauthToken` (`POST /v1/oauth/token`).
- Removed operation `oAuth.oauthRevoke` (`POST /v1/oauth/revoke`).
- Removed operation `oAuth.oauthAuthorizationServerMetadata` (`GET /.well-known/oauth-authorization-server`).
- Removed schema `oauth_token`.
- Removed schema `oauth_scope`.
- Removed schema `oauth_error`.
- Removed schema `oauth_token_request`.
- Removed schema `oauth_revoke_request`.
- Removed schema `oauth_authorization_server_metadata`.
* **api:** 4 breaking changes to the SDK surface.
- Property `api_document.tags` type changed from `unknown` to `string`.
- Property `managed_doc_version.tools` type changed from `Array<object>` to `Array<object>`.
- Property `github_project.accessGroups` type changed from `unknown` to `string`.
- Property `docs_project.accessGroups` type changed from `unknown` to `string`.
* **api:** 10 breaking changes to the SDK surface.
- Removed body field `lastKnownVersionSha` from `registry.updateApiDocumentVersion`.
- Removed body field `lastKnownVersionSha` from `registry.createApiDocumentVersion`.
- Response of `schemas.version.create` changed from `uid` to `none`.
- Schema `slug` shape changed.
- Schema `namespace` shape changed.
- Added required property `managed_doc_version.endpointCount`.
- Removed optional property `managed_doc_version.versionSha`.
- Schema `method` shape changed.
- Added required property `github_project.userInfoHookUrl`.
- Added required property `github_project.analyticsEnabled`.

### Features

* **api:** add operation accessGroups.create (+66 more changes) ([6808193](https://github.com/scalar/scalar-ruby/commit/68081934feaa706b74cfd4902e57ae856d8c0f45))
* **api:** remove operation oAuth.oauthAuthorize (+9 more changes) ([04d9ebb](https://github.com/scalar/scalar-ruby/commit/04d9ebb2a30e0d09d3e236668e2d7c9d27d3a15b))
* **api:** update auth scheme OAuth2 (+1 more change) ([b012cf9](https://github.com/scalar/scalar-ruby/commit/b012cf99690a404e82e60132f32288c7bdee0a81))
* **api:** update property api_document.tags (+3 more changes) ([21db53f](https://github.com/scalar/scalar-ruby/commit/21db53f16e8ed92be07de3f544e780bb44373872))
* **api:** update schema method ([a767517](https://github.com/scalar/scalar-ruby/commit/a767517d8290873f7946c6dc8ac5c1e926109625))
* **api:** update SDK surface (15 changes) ([ec912cc](https://github.com/scalar/scalar-ruby/commit/ec912cc28d1b0a39bda9e8a398a9b59b928f031c))

## [0.1.1](https://github.com/scalar/scalar-ruby/compare/v0.1.0...v0.1.1) (2026-09-15)


Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Files under `examples/` are never modified by the generator.
#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative "../lib/scalar-api-ruby"
require_relative "../lib/scalar_api_ruby"

# ...
```
Expand All @@ -40,13 +40,13 @@ $ ruby ./examples/<your-example>.rb
To install from git in your `Gemfile`:

```ruby
gem "scalar-api-ruby", git: "<repository url>"
gem "scalar_api_ruby", git: "<repository url>"
```

Or reference a local checkout:

```ruby
gem "scalar-api-ruby", path: "/path/to/scalar-api-ruby"
gem "scalar_api_ruby", path: "/path/to/scalar_api_ruby"
```

## Linting, formatting, and typechecking
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
scalar-api-ruby (0.1.1)
scalar_api_ruby (0.2.0)
cgi
connection_pool

Expand Down Expand Up @@ -149,7 +149,7 @@ DEPENDENCIES
rbs
redcarpet
rubocop
scalar-api-ruby!
scalar_api_ruby!
sorbet
steep
syntax_tree
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ The full API of this library can be found in [api.md](./api.md).
Add the gem to your application's `Gemfile`:

```ruby
gem "scalar-api-ruby", "~> 0.1.1" # x-release-please-version
gem "scalar_api_ruby", "~> 0.2.0" # x-release-please-version
```

Or install it directly:

```sh
gem install scalar-api-ruby
gem install scalar_api_ruby
```

<br />

## Usage

```ruby
require "scalar-api-ruby"
require "scalar_api_ruby"

client = Scalar::Client.new(
bearer_auth: ENV["BEARER_AUTH"], # defaults to the BEARER_AUTH env var
Expand All @@ -64,10 +64,12 @@ Pass credentials to the generated client constructor. Environment variables are
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `bearer_auth` | `String \| nil` | - | Credential for the BearerAuth authentication scheme. Defaults to BEARER_AUTH. |
| `o_auth2` | `String \| nil` | - | Authorization code with PKCE (S256), for apps acting on behalf of a Scalar user. Each scope implies the weaker ones. Defaults to SCALAR_OAUTH_TOKEN. |

Declared schemes:

- `BearerAuth` bearer token
- `OAuth2` OAuth2/OpenID Connect

<br />

Expand Down Expand Up @@ -95,7 +97,7 @@ Documented error statuses: `400`, `401`, `403`, `404`, `422`, `500`.
Configure the generated client by setting any of these options when you create it.

```ruby
require "scalar-api-ruby"
require "scalar_api_ruby"

client = Scalar::Client.new(
timeout: 60.0,
Expand All @@ -106,6 +108,7 @@ client = Scalar::Client.new(
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `bearer_auth` | `String \| nil` | `ENV["BEARER_AUTH"]` | Credential for the BearerAuth authentication scheme. |
| `o_auth2` | `String \| nil` | `ENV["SCALAR_OAUTH_TOKEN"]` | Authorization code with PKCE (S256), for apps acting on behalf of a Scalar user. Each scope implies the weaker ones. |
| `base_url` | `String \| nil` | `ENV["SCALAR_BASE_URL"]` | Override the default API base URL. |
| `max_retries` | `Integer` | `2` | Max number of retries to attempt after a failed retryable request. |
| `timeout` | `Float` | `60.0` | Seconds to wait for a response before timing out. |
Expand Down
13 changes: 7 additions & 6 deletions SKILL.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
name: scalar-ruby-sdk
description: "Ruby SDK for Scalar API. Use when writing Ruby code that calls Scalar API with the scalar-api-ruby package: installing it, constructing and authenticating the client, and calling API operations."
description: "Ruby SDK for Scalar API. Use when writing Ruby code that calls Scalar API with the scalar_api_ruby package: installing it, constructing and authenticating the client, and calling API operations."
---

# Scalar Ruby SDK

Generated Ruby client for Scalar API, published as `scalar-api-ruby`. Use the generated client instead of hand-writing HTTP requests.
Generated Ruby client for Scalar API, published as `scalar_api_ruby`. Use the generated client instead of hand-writing HTTP requests.

## Install

Add the gem to your application's `Gemfile`:

```ruby
gem "scalar-api-ruby", "~> 0.1.1" # x-release-please-version
gem "scalar_api_ruby", "~> 0.2.0" # x-release-please-version
```

Or install it directly:

```sh
gem install scalar-api-ruby
gem install scalar_api_ruby
```

## Client setup and authentication

```ruby
require "scalar-api-ruby"
require "scalar_api_ruby"

client = Scalar::Client.new(
bearer_auth: ENV["BEARER_AUTH"], # defaults to the BEARER_AUTH env var
Expand All @@ -34,11 +34,12 @@ client = Scalar::Client.new(
Provide credentials using the options below. Environment variables are read automatically when the target runtime supports them:

- `bearer_auth` (env: `BEARER_AUTH`) — Credential for the BearerAuth authentication scheme.
- `o_auth2` (env: `SCALAR_OAUTH_TOKEN`) — Authorization code with PKCE (S256), for apps acting on behalf of a Scalar user. Each scope implies the weaker ones.

## Calling operations

```ruby
require "scalar-api-ruby"
require "scalar_api_ruby"

client = Scalar::Client.new(
bearer_auth: ENV["BEARER_AUTH"], # defaults to the BEARER_AUTH env var
Expand Down
14 changes: 14 additions & 0 deletions VERSIONING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ different fixes:
platform and the `github-actions` bot to push (or be left unprotected); the default
branch only ever advances by merging release PRs, and `scalar-next` receives each
released state back from the release workflow.
- **`scalar-next` must not enable "Require linear history."** The Scalar platform merges each
regeneration into it, and merges a resolved conflict back the same way; the release sync
adds another merge whenever a release PR is squash- or rebase-merged. That setting rejects
all of them.
- No Actions settings changes are required: the generated workflows declare their own
permissions and never create pull requests.
- If this package publishes through OIDC trusted publishing (for example PyPI or npm),
Expand All @@ -84,3 +88,13 @@ different fixes:
manual re-publishes at an existing tag; register it as an additional trusted publisher
only if you use it. If the publish job is configured with a deployment environment,
include that environment in the registration too.

### Recommended, not required

Releases work without this; it closes a window where one can go out at the wrong version.

- **If this repository uses auto-merge, make the `Release PR version` check a required status
check.** Auto-merge merges as soon as the checks that are *required* go green, with no
human present — so a check that is not required but still red at that moment stops
nothing, which is exactly the window between retitling a release PR and the platform
re-rendering it.
Loading
Loading