Skip to content

Commit

Permalink
fix api
Browse files Browse the repository at this point in the history
  • Loading branch information
shiltemann committed Dec 17, 2024
1 parent b237c4f commit d63630c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
10 changes: 3 additions & 7 deletions _plugins/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module Generators
##
# This class generates the GTN's "api" by writing out a folder full of JSON files.
# TODO: could be a post-write hook.
class APIGenerator
class APIGenerator < Generator

##
# Generates /api/configuration.json
Expand Down Expand Up @@ -342,19 +342,15 @@ def generate(site)
end
end


Jekyll::Hooks.register :site, :post_read do |site|
if Jekyll.env == 'production'
Gtn::Hooks.by_tool(site)
end
Gtn::Hooks.by_tool(site)
end

# Basically like `PageWithoutAFile`, we just write out the ones we'd created earlier.
Jekyll::Hooks.register :site, :post_write do |site|
# No need to run this except in prod.
if Jekyll.env == 'production'
# Our API
api = Jekyll::Generators::APIGenerator.new
api.generate(site)

# Public tool listing: reorganised
if site.data['public-server-tools'] && site.data['public-server-tools']['tools']
Expand Down
16 changes: 16 additions & 0 deletions metadata/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ tags:
description: GTN Contributor Information
- name: internal
description: Internal APIs that aren't much use outside.
- name: galaxy
description: API's with higher reliability guarantee because they are being used inside Galaxy

paths:
/feedback.csv:
Expand Down Expand Up @@ -76,6 +78,20 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/User'

/top-tools.json:
get:
tags:
- galaxy
summary: List available tutorials by tool
responses:
200:
description: successful operation
content:
application/json:
schema:
type: object

/topics.json:
get:
tags:
Expand Down

0 comments on commit d63630c

Please sign in to comment.