--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
File Structure
The Swagger representation of the API is made of a single file. However, parts of the definitions can be split into separate files, at the discretion of the user. This is applicable for
$reffields in the specification as follows from the JSON Schema definitions.By convention, the Swagger specification file is named
swagger.json.
$ref stringAllows for an external definition of this path item. The referenced structure MUST be in the format of a Path Item Object. If there are conflicts between the referenced definition and this Path Item's definition, the behavior is undefined.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
var spec = { .... /* your swagger JSON spec */ .... }
<script src='https://raw.githubusercontent.com/your-repo/your-spec.js' type='text/javascript'></script>
<script type="text/javascript">
$(function () {
window.swaggerUi = new SwaggerUi({
url: "http://localhost:8002/api/api-docs",
dom_id: "swagger-ui-container",
spec: spec,
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
Hello Tony,You are right sorry. I am a new Swagger user and i am trying to became a champion :) .Actually, i am describing my API using YAML. To be able to re use models i split files using the structure below :
- api/commons/
- definitions.yaml
- api/myApi_1/
- swagger-my_Api_1.yaml
- api/myApi_1/
- swagger-my_Api_1.yaml
Hence, in my swagger-my_Api_1.yaml and swagger-my_Api_1.yaml i got some $ref like '../commons/defintions.yaml#/MyModel' .This works like a charm.Now, i need to have a JSON version of each file. Here come problems, as i am not able to make reference to external files.
- It doesn't work with URL reference too. This solution breaks my directory structure logic anyway.
- I am not able to find a complete example of JSON external references to be able to check mine.
- When using external models, do i have to use the definitions markup ? (I do not while using YAML and it works)
- Is relative path working using JSON ?
- I am using Swagger 2.0
Thanks for your help
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.