graphiti-openapi 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/open_api/version.rb +1 -1
- data/lib/tasks/graphiti_openapi.rake +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b55696fb0c02cb5599196242b625518765fa1d0f11247d3cb8a0f38a454873cc
|
4
|
+
data.tar.gz: f610802337a202875a5393d399428c2a8e11695857a11bcbe3625b528f978a5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf849703c5509c968d7a0cde588da465530871409e78b6dc9b941cc28f0c03a319cf4a3604b4b847b163e4e266b389bb4538c2f772f290c86e7dc812981bb71c
|
7
|
+
data.tar.gz: 8a3ff8978c98f24e1679b568d91277ed8a9ebc63c31ca26fd881056895e6f5ebbb3e0c7f801ce2a1a036bb04cd260bb9e7bea7362c951270b5e8e5f3b65622b4
|
@@ -1,4 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require "open-uri"
|
3
|
+
require "pathname"
|
2
4
|
|
3
5
|
jsonapi_schema = 'public/schemas/jsonapi.json'
|
4
6
|
|
@@ -12,7 +14,7 @@ namespace :graphiti do
|
|
12
14
|
system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{installer_template}"
|
13
15
|
end
|
14
16
|
|
15
|
-
task generate:
|
17
|
+
task generate: %W[environment #{jsonapi_schema}] do
|
16
18
|
generator = Graphiti::OpenAPI::Generator.new
|
17
19
|
api = Rails.root.join("public#{ApplicationResource.endpoint_namespace}")
|
18
20
|
api.join("openapi.json").write(generator.to_openapi.to_json)
|
@@ -26,8 +28,6 @@ namespace :assets do
|
|
26
28
|
end
|
27
29
|
|
28
30
|
file jsonapi_schema do |t|
|
29
|
-
|
30
|
-
|
31
|
-
# mkdir_p(File.dirname(t.name))
|
31
|
+
Pathname(t.name).dirname.mkpath
|
32
32
|
File.write(t.name, open('http://jsonapi.org/schema').read)
|
33
33
|
end
|