Skip to content

Instantly share code, notes, and snippets.

@scottw
Created March 13, 2017 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottw/1a46855f44caf79d0549ab43e0793273 to your computer and use it in GitHub Desktop.
Save scottw/1a46855f44caf79d0549ab43e0793273 to your computer and use it in GitHub Desktop.
package Meta;
sub docs {
my $c = shift->openapi->valid_input or return;
$c->respond_to(openapi => $c->openapi->spec(''), any => $c->openapi->spec('')); ## FIXME
}
1;
__DATA__
@@ spec.yaml
swagger: '2.0'
info:
version: 1.0.0
title: My API
#basePath: (not set)
paths:
'/docs':
get:
description: |
Return OpenAPI specification for My API
x-mojo-to: "meta#docs"
responses:
'200':
description: OpenAPI response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment