Skip to content

Commit 3076d3f

Browse files
authored
Merge pull request #243 from akeneo/swagger-json
Generate Swagger JSON specification
2 parents 8bb1230 + e828bb8 commit 3076d3f

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

content/swagger/akeneo-web-api.json

+1
Large diffs are not rendered by default.

readme.md

+5
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 our YAML Swagger spec uses references and links, it is considered as non-valid.
43+
During the build, we generate a valid JSON specification that is put under the `content/swagger` folder. Don't forget to version it if you made any change into the YAML Swagger spec.

src/index.handlebars

+1-1
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

+1
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)