Skip to content

Commit 2ead7bf

Browse files
authored
Merge pull request #5 from simplepractice/oas3
[P4M-646] Use OAS version 3 for Frontend API
2 parents fbe3086 + 527c18e commit 2ead7bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+416
-403
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
# Check for updates to GitHub Actions every weekday
7+
interval: "daily"
8+
- package-ecosystem: bundler
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
time: "11:00"
13+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
3+
name: CI
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
test:
9+
name: "Testing"
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
# Recent Rubies and Rails
16+
- ruby-version: '3.2'
17+
- ruby-version: '3.1'
18+
- ruby-version: '3.0'
19+
- ruby-version: '2.7'
20+
- ruby-version: '2.6'
21+
- ruby-version: '2.6'
22+
- ruby-version: '2.7'
23+
- ruby-version: '2.6'
24+
# Old Rubies and Rails
25+
- ruby-version: '2.5'
26+
bundler: '1'
27+
- ruby-version: '2.4'
28+
bundler: '1'
29+
- ruby-version: '2.4'
30+
bundler: '1'
31+
# Failing with a stack trace in active support
32+
# - ruby-version: '2.4'
33+
# rails-version: '4.1'
34+
# bundler: '1'
35+
36+
continue-on-error: "${{ endsWith(matrix.ruby-version, 'head') }}"
37+
38+
env:
39+
CI: "1"
40+
41+
steps:
42+
- name: "Checkout Code"
43+
uses: "actions/checkout@v4"
44+
timeout-minutes: 5
45+
with:
46+
fetch-depth: 0
47+
48+
# - name: Install required libs
49+
# run: |
50+
# sudo apt-get -yqq install libsqlite3-dev
51+
52+
- name: "Build Ruby"
53+
uses: ruby/setup-ruby@v1
54+
with:
55+
ruby-version: "${{ matrix.ruby-version }}"
56+
bundler: "${{ matrix.bundler || 2 }}"
57+
bundler-cache: true
58+
# env:
59+
# RAILS_VERSION: ${{ matrix.rails-version }}
60+
61+
- name: "Run tests"
62+
run: |
63+
bundle exec rake
64+
# env:
65+
# RAILS_VERSION: ${{ matrix.rails-version }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ example/public/docs
99
*.swp
1010
/html/
1111
/.idea
12+
Gemfile.lock

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
source 'http://rubygems.org'
22

33
gemspec
4-
5-
gem 'inch'

Gemfile.lock

Lines changed: 0 additions & 160 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[![Build Status](https://travis-ci.org/zipmark/rspec_api_documentation.svg?branch=master)](https://travis-ci.org/zipmark/rspec_api_documentation)
2-
[![Dependency Status](https://gemnasium.com/badges/github.com/zipmark/rspec_api_documentation.svg)](https://gemnasium.com/github.com/zipmark/rspec_api_documentation)
31
[![Code Climate](https://codeclimate.com/github/zipmark/rspec_api_documentation/badges/gpa.svg)](https://codeclimate.com/github/zipmark/rspec_api_documentation)
42
[![Inline docs](https://inch-ci.org/github/zipmark/rspec_api_documentation.svg?branch=master)](https://inch-ci.org/github/zipmark/rspec_api_documentation)
53
[![Gem Version](https://badge.fury.io/rb/rspec_api_documentation.svg)](https://badge.fury.io/rb/rspec_api_documentation)
@@ -185,6 +183,7 @@ RspecApiDocumentation.configure do |config|
185183
config.configurations_dir = Rails.root.join("doc", "configurations", "api")
186184

187185
# Output folder
186+
# **WARNING*** All contents of the configured directory will be cleared, use a dedicated directory.
188187
config.docs_dir = Rails.root.join("doc", "api")
189188

190189
# An array of output format(s).
@@ -238,6 +237,7 @@ RspecApiDocumentation.configure do |config|
238237
config.define_group :public do |config|
239238
# By default the group's doc_dir is a subfolder under the parent group, based
240239
# on the group's name.
240+
# **WARNING*** All contents of the configured directory will be cleared, use a dedicated directory.
241241
config.docs_dir = Rails.root.join("doc", "api", "public")
242242

243243
# Change the filter to only include :public examples

features/oauth2_mac_client.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Feature: Use OAuth2 MAC client as a test client
22
Background:
33
Given a file named "app_spec.rb" with:
44
"""
5+
require "webmock/rspec"
56
require "rspec_api_documentation"
67
require "rspec_api_documentation/dsl"
78
require "rack/builder"

features/readme.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[![Travis status](https://secure.travis-ci.org/zipmark/rspec_api_documentation.png)](https://secure.travis-ci.org/zipmark/rspec_api_documentation)
2-
[![Gemnasium status](https://gemnasium.com/zipmark/rspec_api_documentation.png)](https://gemnasium.com/zipmark/rspec_api_documentation)
3-
41
http://github.com/zipmark/rspec_api_documentation
52

63
# RSpec API Doc Generator

lib/rspec_api_documentation.rb

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
require 'active_support'
22
require 'active_support/inflector'
3+
require 'active_support/core_ext/array/extract_options'
34
require 'active_support/core_ext/hash/conversions'
45
require 'active_support/core_ext/hash/deep_merge'
6+
require 'active_support/core_ext/hash/keys'
57
require 'cgi'
68
require 'json'
79

@@ -52,25 +54,27 @@ module Writers
5254
module OpenApi
5355
extend ActiveSupport::Autoload
5456

57+
autoload :Components
58+
autoload :Contact
59+
autoload :ExternalDocs
60+
autoload :Flow
61+
autoload :Header
5562
autoload :Helper
56-
autoload :Node
57-
autoload :Root
5863
autoload :Info
59-
autoload :Contact
6064
autoload :License
61-
autoload :Paths
62-
autoload :Path
63-
autoload :Tag
65+
autoload :Media
66+
autoload :Node
6467
autoload :Operation
6568
autoload :Parameter
66-
autoload :Responses
69+
autoload :Path
70+
autoload :RequestBody
6771
autoload :Response
68-
autoload :Example
69-
autoload :Headers
70-
autoload :Header
72+
autoload :Root
7173
autoload :Schema
72-
autoload :SecurityDefinitions
73-
autoload :SecuritySchema
74+
autoload :SecurityScheme
75+
autoload :Server
76+
autoload :Tag
77+
autoload :Variable
7478
end
7579

7680
module Views

lib/rspec_api_documentation/dsl/resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def self.define_action(method)
3030

3131
def callback(*args, &block)
3232
begin
33-
require 'webmock'
33+
require 'webmock/rspec'
3434
rescue LoadError
3535
raise "Callbacks require webmock to be installed"
3636
end

lib/rspec_api_documentation/oauth2_mac_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# ActiveSupport::SecureRandom not provided in activesupport >= 3.2
55
end
66
begin
7-
require "webmock"
7+
require "webmock/rspec"
88
rescue LoadError
99
raise "Webmock needs to be installed before using the OAuth2MACClient"
1010
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module RspecApiDocumentation
2+
module OpenApi
3+
class Components < Node
4+
add_setting :schemas, :schema => { '' => Schema }
5+
add_setting :responses, :schema => { '' => Response }
6+
add_setting :parameters, :schema => { '' => Parameter }
7+
add_setting :headers, :schema => { '' => Header }
8+
add_setting :securitySchemes, :schema => { '' => SecurityScheme }
9+
add_setting :links
10+
add_setting :callbacks
11+
end
12+
end
13+
end

lib/rspec_api_documentation/open_api/example.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)