Skip to content

Commit 7df576b

Browse files
committed
Generate Swagger JSON specification
1 parent 8bb1230 commit 7df576b

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

content/swagger/akeneo-web-api.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ npm serve
3636

3737
The API documentation site is then available on `localhost:8000`.
3838
Files located in the content and src directories are watched for changes, so when developing you do not need to launch any other task.
39+
40+
## Swagger
41+
42+
As Swagger YAML spec uses references and links, the speification is considred as non valid.
43+
Therefore, the valid JSON specification "content/swagger/akeneo-web-api.json" is generated during the build and should be versionned.

src/index.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</div>
9191
<div class="col-sm-4">
9292
<div class="panel panel-default panel-btn">
93-
<a href="https://github.com/akeneo/pim-api-docs/blob/master/content/swagger/akeneo-web-api.yaml">
93+
<a href="https://github.com/akeneo/pim-api-docs/blob/master/content/swagger/akeneo-web-api.json">
9494
<div class="panel-body">
9595
<div class="row">
9696
<div class="col-xs-offset-4 col-xs-4 col-sm-offset-2 col-sm-8 col-md-offset-3 col-md-6">

tasks/reference.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ gulp.task('reference', ['clean-dist', 'less'], function() {
101101

102102
gulp.src('./content/swagger/akeneo-web-api.yaml')
103103
.pipe(swagger('akeneo-web-api.json'))
104+
.pipe(gulp.dest('content/swagger'))
104105
.pipe(jsonTransform(function(data, file) {
105106
var templateData = data;
106107
data.categories = {};

0 commit comments

Comments
 (0)