Last active
January 24, 2019 16:15
-
-
Save kamilkisiela/9ffedc6d63b09e5a58a6277890c41fde to your computer and use it in GitHub Desktop.
Sofa with OpenAPI (Swagger)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sofa, { OpenAPI } from 'sofa-api'; | |
const openApi = OpenAPI({ | |
schema, | |
info: { | |
title: 'Example API', | |
version: '3.0.0', | |
}, | |
}); | |
app.use( | |
sofa({ | |
schema, | |
onRoute(info) { | |
openApi.addRoute(info, { | |
basePath: '', | |
}); | |
}, | |
}) | |
); | |
openApi.save('./swagger.json'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment