ask-schema 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +44 -0
- data/lib/ask/schema/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '048a8d82b87749d450ee5ff7359b4ea55b81bb0f5ed8213b267947ea1bae72cb'
|
|
4
|
+
data.tar.gz: 0ae6c10cbf2e6a7a7842dfe76593120d019f0755222c242a89b892fcb4fe61c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2c5c3415975e02742ec22c682e5074fb2ee44ef0d8c6c0a44e7e658f55845858fc047f56768821c2cea81aa546d99295fb9e803c2cc97930195e881ec325945
|
|
7
|
+
data.tar.gz: 7e26f7f403b7b5b0d9016323b55b91488dbdcb8b0ca47c38a47f1066c4a7f78a57f0f80fd8577989d549dfa7746aa0827a202d384aa79b1ec2a868477a4385b7
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
## [0.1.1] - 2026-06-25
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
- Robustness suite (11 tests): empty schemas, edge cases, schema isolation. Infrastructure: rubocop, overcommit, bin/setup, CI matrix, gemspec test.
|
|
5
|
+
# Changelog
|
|
6
|
+
|
|
7
|
+
## [0.1.0] - 2026-06-21
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Initial release of `ask-schema` — a zero-dependency Ruby DSL for building JSON Schema documents.
|
|
12
|
+
- Ported from `ruby_llm-schema` v0.4.0 with namespace repackage (`RubyLLM::Schema` → `Ask::Schema`).
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **Block-based DSL** — `Ask::Schema.create { string(:name); integer(:age) }` for inline schema definitions
|
|
17
|
+
- **Class-based DSL** — `class Product < Ask::Schema; string :name; end` for reusable schema classes
|
|
18
|
+
- **Primitive types** — `string`, `number`, `integer`, `boolean`, `null` with full constraint support
|
|
19
|
+
- **Complex types** — `object`, `array`, `any_of`, `one_of`, `enum`, `const`
|
|
20
|
+
- **Composition** — `define`/`reference` for named sub-schemas with `$defs` and `$ref`
|
|
21
|
+
- **Conditionals** — `given`/`then`/`else` for conditional validation, `dependent` for property dependencies
|
|
22
|
+
- **Validation** — Circular reference detection via DFS topological sort
|
|
23
|
+
- **JSON output** — `to_json_schema` (hash) and `to_json` (pretty-printed JSON string)
|
|
24
|
+
- **Strict mode** — `strict`, `additionalProperties` controls with sensible defaults
|
|
25
|
+
- **Modifiers** — `description`, `default`, `minimum`, `maximum`, `pattern`, `format`, `min_length`, `max_length`, `enum`, `multiple_of`, `min_items`, `max_items`
|
|
26
|
+
- **Optional fields** — `required: false` and `optional { ... }` helper for nullable properties
|
|
27
|
+
- **Dependencies** — Zero runtime dependencies. stdlib only (`json`).
|
|
28
|
+
- **Ruby 3.2+** — Uses anonymous block forwarding, endless methods, and modern Ruby idioms.
|
|
29
|
+
|
|
30
|
+
### Ported modules
|
|
31
|
+
|
|
32
|
+
| Module | Source | Lines |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `Ask::Schema` | `lib/ask/schema.rb` | 99 |
|
|
35
|
+
| DSL assembly | `lib/ask/schema/dsl.rb` | 19 |
|
|
36
|
+
| Schema builders | `lib/ask/schema/dsl/schema_builders.rb` | 186 |
|
|
37
|
+
| Primitive types | `lib/ask/schema/dsl/primitive_types.rb` | 29 |
|
|
38
|
+
| Complex types | `lib/ask/schema/dsl/complex_types.rb` | 32 |
|
|
39
|
+
| Conditionals | `lib/ask/schema/dsl/conditionals.rb` | 169 |
|
|
40
|
+
| Utilities | `lib/ask/schema/dsl/utilities.rb` | 62 |
|
|
41
|
+
| JSON output | `lib/ask/schema/json_output.rb` | 37 |
|
|
42
|
+
| Validator | `lib/ask/schema/validator.rb` | 81 |
|
|
43
|
+
| Errors | `lib/ask/schema/errors.rb` | 30 |
|
|
44
|
+
| Helpers | `lib/ask/schema/helpers.rb` | 12 |
|
data/lib/ask/schema/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-schema
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kaka Ruto
|
|
@@ -59,6 +59,7 @@ executables: []
|
|
|
59
59
|
extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
|
61
61
|
files:
|
|
62
|
+
- CHANGELOG.md
|
|
62
63
|
- LICENSE
|
|
63
64
|
- README.md
|
|
64
65
|
- lib/ask-schema.rb
|
|
@@ -76,7 +77,10 @@ files:
|
|
|
76
77
|
homepage: https://github.com/ask-rb/ask-schema
|
|
77
78
|
licenses:
|
|
78
79
|
- MIT
|
|
79
|
-
metadata:
|
|
80
|
+
metadata:
|
|
81
|
+
homepage_uri: https://github.com/ask-rb/ask-schema
|
|
82
|
+
source_code_uri: https://github.com/ask-rb/ask-schema
|
|
83
|
+
changelog_uri: https://github.com/ask-rb/ask-schema/blob/master/CHANGELOG.md
|
|
80
84
|
rdoc_options: []
|
|
81
85
|
require_paths:
|
|
82
86
|
- lib
|