MVP of swagger documentation
Some checks failed
Check usage of free licenses / check-licenses (pull_request) Successful in 40s
Add copyright notice / copyright_notice (pull_request) Successful in 1m23s
Run unit tests / unit_tests (pull_request) Failing after 3m5s

This commit is contained in:
Manuel Bustillo 2024-11-15 18:28:45 +01:00
parent 8a3469447b
commit bcbcf9b469
5 changed files with 26 additions and 4 deletions

3
.gitignore vendored
View File

@ -33,3 +33,6 @@
# Ignore master key for decrypting credentials and more. # Ignore master key for decrypting credentials and more.
/config/master.key /config/master.key
# Ignore swagger generated documentation
swagger/v1/swagger.yaml

View File

@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1 # syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile # Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.3.5 ARG RUBY_VERSION=3.3.6
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
# Rails app lives here # Rails app lives here

View File

@ -8,7 +8,7 @@ Rswag::Ui.configure do |c|
# (under openapi_root) as JSON or YAML endpoints, then the list below should # (under openapi_root) as JSON or YAML endpoints, then the list below should
# correspond to the relative paths for those endpoints. # correspond to the relative paths for those endpoints.
c.swagger_endpoint '/api-docs/v1/swagger.yaml', 'API V1 Docs' c.swagger_endpoint '/api/api-docs/v1/swagger.yaml', 'API V1 Docs'
# Add Basic Auth in case your API is private # Add Basic Auth in case your API is private
# c.basic_auth_enabled = true # c.basic_auth_enabled = true

View File

@ -0,0 +1,19 @@
require 'swagger_helper'
RSpec.describe 'groups', type: :request do
path '/groups' do
get('list groups') do
response(200, 'successful') do
after do |example|
example.metadata[:response][:content] = {
'application/json' => {
example: JSON.parse(response.body, symbolize_names: true)
}
}
end
run_test!
end
end
end
end

View File

@ -24,10 +24,10 @@ RSpec.configure do |config|
paths: {}, paths: {},
servers: [ servers: [
{ {
url: 'https://{defaultHost}', url: 'http://{defaultHost}/api',
variables: { variables: {
defaultHost: { defaultHost: {
default: 'www.example.com' default: 'libre-wedding-planner.app.localhost'
} }
} }
} }