Skip to content

Commit

Permalink
[CRIMAPP-1608] Add open api documentation (#374)
Browse files Browse the repository at this point in the history
Add open api documentation
  • Loading branch information
hiboabd authored Feb 19, 2025
1 parent 4b82400 commit 0279ce2
Show file tree
Hide file tree
Showing 4 changed files with 785 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem 'rails', '~> 7.1.4', '>= 7.1.4.1'
gem 'grape', '~> 2.1.3'
gem 'grape-entity', '~> 1.0.1'
gem 'grape_logging'
gem 'grape-swagger'
gem 'kaminari-activerecord'

# Monitoring
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ GEM
grape-entity (1.0.1)
activesupport (>= 3.0.0)
multi_json (>= 1.3.2)
grape-swagger (2.1.2)
grape (>= 1.7, < 3.0)
rack-test (~> 2)
grape_logging (1.8.4)
grape
rack
Expand Down Expand Up @@ -390,6 +393,7 @@ DEPENDENCIES
dotenv-rails (~> 2.8.1)
grape (~> 2.1.3)
grape-entity (~> 1.0.1)
grape-swagger
grape_logging
kaminari-activerecord
laa-criminal-legal-aid-schemas!
Expand Down
9 changes: 9 additions & 0 deletions app/api/datastore/root.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'grape-swagger'

module Datastore
class Root < Base
format :json
Expand All @@ -17,6 +19,13 @@ class Root < Base
mount V1::Reviewing
mount V1::Healthcheck

add_swagger_documentation(
info: { title: 'Criminal Applications Datastore - v1' },
api_version: 'v1',
hide_documentation_path: true,
mount_path: '/documentation',
)

desc 'Catch-all route.'
route_setting :authorised_consumers, %w[*]

Expand Down
Loading

0 comments on commit 0279ce2

Please sign in to comment.