Skip to content

OAS version 3 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 61 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
15054e6
Remove child class gotcha
aadityataparia Dec 3, 2018
4baa951
Remove child_class completely
aadityataparia Dec 3, 2018
03abdc6
Add path root spec
aadityataparia Dec 3, 2018
5749585
Change to open api spec 3.0
aadityataparia Dec 6, 2018
ce261dd
add warning for `config.docs_dir`
jakehow May 4, 2019
ca1ded5
Clean up Gemfile stuff
davidstosik Feb 6, 2020
2c5d811
Relax Bundler dependency
davidstosik Feb 6, 2020
65ee973
Freeze development dependencies while we figure out what breaks
davidstosik Feb 6, 2020
2770148
Freeze more development dependencies to get a green CI
davidstosik Feb 6, 2020
a858252
Merge pull request #461 from davidstosik/CI-tests
jakehow Sep 10, 2020
adb498a
Merge pull request #442 from zipmark/add_custom_dir_warning
jakehow Sep 10, 2020
b0e5889
Allow response_body_formatter config to format "binary" responses (#458)
davidstosik Oct 2, 2020
2e469c4
Remove dev dependency to Thin (#479)
davidstosik Oct 2, 2020
66a253a
Remove deprecated key in .travis.yml (#482)
davidstosik Oct 2, 2020
1a164bc
Test more recent versions of Ruby on Travis (#480)
davidstosik Oct 2, 2020
d3892cc
Remove Gemnasium links (#481)
davidstosik Oct 2, 2020
a0d0745
Require explicitly ActiveSupport Array#extract_options!
keram Jun 10, 2022
40c1dfc
Bump dev dependency on Faraday gem to ~> 1.0.0
keram Jun 10, 2022
758c879
Require explicitly ActiveSupport Hash::Keys
keram Jun 10, 2022
26af788
Update Api Blueprint spec assertions to reflect implementation
keram Jun 10, 2022
8530790
testing
Jan 13, 2023
f9e78b5
support ruby32 syntax
Jan 13, 2023
269213b
Merge pull request #1 from nicolaa/spike
nicolaa Jan 13, 2023
277b4c8
ci: remove TravisCI
bf4 Apr 25, 2024
7c25673
ci: add github actions ci workflow
bf4 Apr 25, 2024
876cf4a
deps(dependabot): add dependabot config
bf4 Apr 25, 2024
6b721af
Merge pull request #515 from x-b-e/switch_to_github_actions
bf4 Apr 25, 2024
115605a
Bump actions/checkout from 2 to 4
dependabot[bot] Apr 25, 2024
be311da
Update rack-oauth2 requirement from ~> 1.2.2 to ~> 1.12.0
dependabot[bot] Apr 25, 2024
5c71cee
Update rspec requirement from ~> 3.4.0 to ~> 3.13.0
dependabot[bot] Apr 25, 2024
e74afb8
Update aruba requirement from ~> 0.13.0 to ~> 0.14.14
dependabot[bot] Apr 25, 2024
1fb5f4b
Merge pull request #516 from zipmark/dependabot/github_actions/action…
bf4 Apr 25, 2024
8db1a32
Merge pull request #517 from zipmark/dependabot/bundler/rack-oauth2-t…
bf4 Apr 25, 2024
fe95f3e
Merge pull request #518 from zipmark/dependabot/bundler/rspec-tw-3.13.0
bf4 Apr 25, 2024
e08ba63
Merge pull request #520 from zipmark/dependabot/bundler/aruba-tw-0.14.14
bf4 Apr 25, 2024
09f69e3
Update contracts requirement from ~> 0.13.0 to ~> 0.17
dependabot[bot] Apr 25, 2024
afa5de2
Merge pull request #521 from zipmark/dependabot/bundler/contracts-tw-…
bf4 Apr 25, 2024
afc5c47
Update multi_json requirement from ~> 1.11.2 to ~> 1.15.0
dependabot[bot] Apr 25, 2024
3cfa9c0
Update rspec-its requirement from ~> 1.2.0 to ~> 1.3.0
dependabot[bot] Apr 25, 2024
a5d39c2
Merge pull request #523 from zipmark/dependabot/bundler/multi_json-tw…
bf4 Apr 25, 2024
3d5521b
Update capybara requirement from ~> 2.6.2 to ~> 3.39.2
dependabot[bot] Apr 25, 2024
521a66a
Merge pull request #524 from zipmark/dependabot/bundler/capybara-tw-3…
bf4 Apr 25, 2024
be391f7
Merge pull request #525 from zipmark/dependabot/bundler/rspec-its-tw-…
bf4 Apr 25, 2024
58d5bd1
Update rake requirement from ~> 10.5.0 to ~> 13.2.1
dependabot[bot] Apr 25, 2024
ab4c568
Update sinatra requirement from ~> 1.4.7 to ~> 2.0.8
dependabot[bot] Apr 25, 2024
a248170
Merge pull request #529 from zipmark/dependabot/bundler/sinatra-tw-2.0.8
bf4 Apr 25, 2024
fe505ff
Update gherkin requirement from ~> 3.2.0 to ~> 9.0.0
dependabot[bot] Apr 25, 2024
09b8659
Merge pull request #527 from zipmark/dependabot/bundler/rake-tw-13.2.1
bf4 Apr 25, 2024
6251232
Update webmock requirement from ~> 3.8.3 to ~> 3.23.0
dependabot[bot] Apr 25, 2024
f30b6d8
Merge pull request #519 from zipmark/dependabot/bundler/webmock-tw-3.…
bf4 Apr 25, 2024
c1a782d
Merge pull request #522 from zipmark/dependabot/bundler/gherkin-tw-9.0.0
bf4 Apr 25, 2024
6c6f651
Merge branch 'master' of https://github.com/nicolaa/rspec_api_documen…
bf4 Apr 25, 2024
c80f509
Merge branch 'nicolaa-master'
bf4 Apr 25, 2024
825cebd
Merge branch 'failing-specs' of https://github.com/keram/rspec_api_do…
bf4 Apr 25, 2024
d32bf17
Merge branch 'keram-failing-specs'
bf4 Apr 25, 2024
bd393ba
Merge remote-tracking branch 'upstream/master' into oas3
krasnoukhov May 13, 2025
a60933d
Merge remote-tracking branch 'aadi/aadi/oas3' into oas3
krasnoukhov May 13, 2025
1b4f211
OAS3 requestBody to include all defined parameters
krasnoukhov May 19, 2025
7396c01
correct header/query formatting for slate
krasnoukhov May 19, 2025
3896fb0
handle case with no properties for scope
krasnoukhov May 20, 2025
02c00ec
prevent empty required
krasnoukhov May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---

name: CI

on: [push, pull_request]

jobs:
test:
name: "Testing"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Recent Rubies and Rails
- ruby-version: '3.2'
- ruby-version: '3.1'
- ruby-version: '3.0'
- ruby-version: '2.7'
- ruby-version: '2.6'
- ruby-version: '2.6'
- ruby-version: '2.7'
- ruby-version: '2.6'
# Old Rubies and Rails
- ruby-version: '2.5'
bundler: '1'
- ruby-version: '2.4'
bundler: '1'
- ruby-version: '2.4'
bundler: '1'
# Failing with a stack trace in active support
# - ruby-version: '2.4'
# rails-version: '4.1'
# bundler: '1'

continue-on-error: "${{ endsWith(matrix.ruby-version, 'head') }}"

env:
CI: "1"

steps:
- name: "Checkout Code"
uses: "actions/checkout@v4"
timeout-minutes: 5
with:
fetch-depth: 0

# - name: Install required libs
# run: |
# sudo apt-get -yqq install libsqlite3-dev

- name: "Build Ruby"
uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby-version }}"
bundler: "${{ matrix.bundler || 2 }}"
bundler-cache: true
# env:
# RAILS_VERSION: ${{ matrix.rails-version }}

- name: "Run tests"
run: |
bundle exec rake
# env:
# RAILS_VERSION: ${{ matrix.rails-version }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ example/public/docs
*.swp
/html/
/.idea
Gemfile.lock
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source 'http://rubygems.org'

gemspec

gem 'inch'
160 changes: 0 additions & 160 deletions Gemfile.lock

This file was deleted.

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

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

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

# Change the filter to only include :public examples
Expand Down
1 change: 1 addition & 0 deletions features/oauth2_mac_client.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Feature: Use OAuth2 MAC client as a test client
Background:
Given a file named "app_spec.rb" with:
"""
require "webmock/rspec"
require "rspec_api_documentation"
require "rspec_api_documentation/dsl"
require "rack/builder"
Expand Down
3 changes: 0 additions & 3 deletions features/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[![Travis status](https://secure.travis-ci.org/zipmark/rspec_api_documentation.png)](https://secure.travis-ci.org/zipmark/rspec_api_documentation)
[![Gemnasium status](https://gemnasium.com/zipmark/rspec_api_documentation.png)](https://gemnasium.com/zipmark/rspec_api_documentation)

http://github.com/zipmark/rspec_api_documentation

# RSpec API Doc Generator
Expand Down
28 changes: 16 additions & 12 deletions lib/rspec_api_documentation.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'active_support'
require 'active_support/inflector'
require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/hash/conversions'
require 'active_support/core_ext/hash/deep_merge'
require 'active_support/core_ext/hash/keys'
require 'cgi'
require 'json'

Expand Down Expand Up @@ -52,25 +54,27 @@ module Writers
module OpenApi
extend ActiveSupport::Autoload

autoload :Components
autoload :Contact
autoload :ExternalDocs
autoload :Flow
autoload :Header
autoload :Helper
autoload :Node
autoload :Root
autoload :Info
autoload :Contact
autoload :License
autoload :Paths
autoload :Path
autoload :Tag
autoload :Media
autoload :Node
autoload :Operation
autoload :Parameter
autoload :Responses
autoload :Path
autoload :RequestBody
autoload :Response
autoload :Example
autoload :Headers
autoload :Header
autoload :Root
autoload :Schema
autoload :SecurityDefinitions
autoload :SecuritySchema
autoload :SecurityScheme
autoload :Server
autoload :Tag
autoload :Variable
end

module Views
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/dsl/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def self.define_action(method)

def callback(*args, &block)
begin
require 'webmock'
require 'webmock/rspec'
rescue LoadError
raise "Callbacks require webmock to be installed"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/oauth2_mac_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ActiveSupport::SecureRandom not provided in activesupport >= 3.2
end
begin
require "webmock"
require "webmock/rspec"
rescue LoadError
raise "Webmock needs to be installed before using the OAuth2MACClient"
end
Expand Down
13 changes: 13 additions & 0 deletions lib/rspec_api_documentation/open_api/components.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module RspecApiDocumentation
module OpenApi
class Components < Node
add_setting :schemas, :schema => { '' => Schema }
add_setting :responses, :schema => { '' => Response }
add_setting :parameters, :schema => { '' => Parameter }
add_setting :headers, :schema => { '' => Header }
add_setting :securitySchemes, :schema => { '' => SecurityScheme }
add_setting :links
add_setting :callbacks
end
end
end
7 changes: 0 additions & 7 deletions lib/rspec_api_documentation/open_api/example.rb

This file was deleted.

Loading
Loading