bullet_train-api 1.4.6 → 1.4.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dadab536da4317e9f52b3e1a6f2fa4dae55f467ea742f19f458e101a2172c451
4
- data.tar.gz: e001e82734b9432a2b6f4aba15f7629d968e4023a414edfcd75bba315a85a855
3
+ metadata.gz: 418462d2aa9af4a84533d5c3fea8bbbdf5e4a09fb12c934cf1eebf81f64b6ef8
4
+ data.tar.gz: f56ce158eb38fefc80f131b9ea64e58e67589d0af2e788be07709d0289d8ce19
5
5
  SHA512:
6
- metadata.gz: 975b861c0863cc62b1535b1378df14561f15d7ef8def20461dea28dfdbe15fe41da8eb623c6b1e7222d7f29ead4a8441b8be3a9c7e383238edf8e31d0f28cb21
7
- data.tar.gz: b5701f2f28d3197b66e55b9c1ccb905813116fa4f3dc0f7d7fbb2ae8d78a5fbddf3fa53c5c189644367243dc594d597bad9c4c750fc2c3903f0e7189d3a37dfc
6
+ metadata.gz: 23b5fe1738277b443419a63cf33294263391fd4e5d73bbe8f63810d8d60574587a53527a6d0c5fca8a751638c3367c6ab4279a0d0e3e4e38ecf59b1faaae4dc2
7
+ data.tar.gz: 39ddcc4efca744f41360f290cd7e9f5b4ee5b20789007741f5eabdd83a2e93458f23a2c2ad15c6aeb560078e9b755c3ee3fb24094e7afb01fcf0fb233cf1e563
@@ -8,7 +8,7 @@ class Api::OpenApiController < ApplicationController
8
8
  before_action :set_default_response_format
9
9
 
10
10
  def index
11
- @version = params[:version]
11
+ @version = params[:version].match?(/v\d+/) ? params[:version] : raise("Unknown version error")
12
12
  render "api/#{@version}/open_api/index", layout: nil, format: :text
13
13
  end
14
14
  end
@@ -44,7 +44,8 @@ module Api
44
44
 
45
45
  def automatic_components_for(model, locals: {})
46
46
  path = "app/views/api/#{@version}"
47
- paths = ([path] + gem_paths.map { |gem_path| "#{gem_path}/#{path}" })
47
+ paths = [path, "app/views"] + gem_paths.product(%W[/#{path} /app/views]).map(&:join)
48
+
48
49
  jbuilder = Jbuilder::Schema.renderer(paths, locals: {
49
50
  # If we ever get to the point where we need a real model here, we should implement an example team in seeds that we can source it from.
50
51
  model.name.underscore.split("/").last.to_sym => model.new,
@@ -62,7 +63,7 @@ module Api
62
63
  example || model.new,
63
64
  title: I18n.t("#{model.name.underscore.pluralize}.label"),
64
65
  # TODO Improve this. We don't have a generic description for models we can use here.
65
- description: I18n.t("#{model.name.underscore.pluralize}.label"),
66
+ description: I18n.t("#{model.name.underscore.pluralize}.label")
66
67
  )
67
68
 
68
69
  attributes_output = JSON.parse(schema_json)
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Api
3
- VERSION = "1.4.6"
3
+ VERSION = "1.4.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-20 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 2.2.0
103
+ version: 2.3.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 2.2.0
110
+ version: 2.3.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: factory_bot
113
113
  requirement: !ruby/object:Gem::Requirement