Skip to content

Commit

Permalink
Merge pull request #243 from akeneo/swagger-json
Browse files Browse the repository at this point in the history
Generate Swagger JSON specification
  • Loading branch information
ahocquard authored Dec 10, 2018
2 parents 8bb1230 + e828bb8 commit 3076d3f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions content/swagger/akeneo-web-api.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ npm serve

The API documentation site is then available on `localhost:8000`.
Files located in the content and src directories are watched for changes, so when developing you do not need to launch any other task.

## Swagger

As our YAML Swagger spec uses references and links, it is considered as non-valid.
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.
2 changes: 1 addition & 1 deletion src/index.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</div>
<div class="col-sm-4">
<div class="panel panel-default panel-btn">
<a href="https://github.com/akeneo/pim-api-docs/blob/master/content/swagger/akeneo-web-api.yaml">
<a href="https://github.com/akeneo/pim-api-docs/blob/master/content/swagger/akeneo-web-api.json">
<div class="panel-body">
<div class="row">
<div class="col-xs-offset-4 col-xs-4 col-sm-offset-2 col-sm-8 col-md-offset-3 col-md-6">
Expand Down
1 change: 1 addition & 0 deletions tasks/reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ gulp.task('reference', ['clean-dist', 'less'], function() {

gulp.src('./content/swagger/akeneo-web-api.yaml')
.pipe(swagger('akeneo-web-api.json'))
.pipe(gulp.dest('content/swagger'))
.pipe(jsonTransform(function(data, file) {
var templateData = data;
data.categories = {};
Expand Down

0 comments on commit 3076d3f

Please sign in to comment.