Skip to content

Commit

Permalink
Global configuration documentation
Browse files Browse the repository at this point in the history
Forgot to add this as part of: #170
  • Loading branch information
davishmcclurg committed Mar 2, 2024
1 parent 20cc3f8 commit 045a95d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,20 @@ JSONSchemer.schema(
)
```

## Global Configuration

Configuration options can be set globally by modifying `JSONSchemer.configuration`. Global options are applied to any new schemas at creation time (global configuration changes are not reflected in existing schemas). They can be overridden with the regular keyword arguments described [above](#options).

```ruby
# configuration block
JSONSchemer.configure do |config|
config.regexp_resolver = 'ecma'
end

# configuration accessors
JSONSchemer.configuration.insert_property_defaults = true
```

## Custom Error Messages

Error messages can be customized using the `x-error` keyword and/or [I18n](https://github.com/ruby-i18n/i18n) translations. `x-error` takes precedence if both are defined.
Expand Down

0 comments on commit 045a95d

Please sign in to comment.