You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve README and add documentation structure (#91)
## Summary
- Improve README with comprehensive documentation explaining what the
gem does
- Add Related Projects and Compatibility sections
- Add AGENTS.md for AI agent instructions
- Create docs/ folder with progressive disclosure documentation
## Changes
**README.md:**
- Clear explanation of what the gem does and example output
- Related Projects section linking to grape ecosystem
- Compatibility table with version requirements
- Usage examples (basic, custom descriptions, references)
- Simplified Development/Contributing sections with links to docs
**AGENTS.md:**
- Minimal root file with essential commands and constraints
- Links to detailed documentation
**docs/:**
- `architecture.md` - Component overview and data flow
- `contributing.md` - PR requirements, CHANGELOG format
- `documentation-options.md` - Full options table with examples
- `testing.md` - Test patterns, shared contexts, issue specs
Fixes#58
Copy file name to clipboardExpand all lines: README.md
+102-7Lines changed: 102 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,64 @@
6
6
## Table of Contents
7
7
8
8
-[What is grape-swagger-entity?](#what-is-grape-swagger-entity)
9
+
-[What it does](#what-it-does)
10
+
-[Example Output](#example-output)
11
+
-[Related Projects](#related-projects)
12
+
-[Compatibility](#compatibility)
9
13
-[Installation](#installation)
14
+
-[Usage](#usage)
15
+
-[Basic Entity](#basic-entity)
16
+
-[Custom Model Description](#custom-model-description)
17
+
-[Entity References](#entity-references)
18
+
-[Documentation Options](#documentation-options)
10
19
-[Development](#development)
11
20
-[Contributing](#contributing)
12
21
-[License](#license)
13
22
14
-
15
23
## What is grape-swagger-entity?
16
24
17
-
A simple grape-swagger adapter to allow parse representers as response model
25
+
This gem provides an adapter for [grape-swagger](https://github.com/ruby-grape/grape-swagger) that allows parsing [grape-entity](https://github.com/ruby-grape/grape-entity) classes to generate OpenAPI/Swagger model definitions automatically.
26
+
27
+
### What it does
28
+
29
+
- Generates `definitions` in your Swagger JSON from Grape::Entity exposures
30
+
- Maps entity properties to OpenAPI schema properties with types and descriptions
31
+
- Handles nested entities and entity references via `$ref`
32
+
- Supports arrays, required fields, and documentation options
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/pry` for an interactive prompt that will allow you to experiment.
100
+
Override the default "{ModelName} model" description by defining a `self.documentation` method. This feature is handled by [grape-swagger](https://github.com/ruby-grape/grape-swagger) (requires grape-swagger >= 2.2.0):
38
101
39
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
102
+
```ruby
103
+
classUserEntity < Grape::Entity
104
+
defself.documentation
105
+
{ desc:'Represents a user account with profile information' }
0 commit comments