Is there an API to update the file definition? I am looking for a way to keep my project in Git and SwaggerHub in sync automatically, so I would like to update the file definition at every merge. Is it possible? How do you manage keeping your project and SwaggerHub definition in sync automatically?
Yes, SwaggerHub has an API:
https://api.swaggerhub.com
Integrating with the SwaggerHub API
You can update your API definitions in SwaggerHub like this:
POST https://api.swaggerhub.com/apis/OWNER/API_NAME
Authorization: YOUR_API_KEY
Content-Type: application/yaml
# Request body is your complete YAML/JSON file
swagger: '2.0'
info:
title: My API
version: 1.0.0
paths:
...
Use Content-Type: application/yaml
if uploading YAML and Content-Type: application/json
if uploading JSON.
来源:https://stackoverflow.com/questions/52650853/is-there-an-api-in-swaggerhub-to-update-the-file-definition