-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't generate index.md when "paramaters" field exists #8
Comments
Hi, |
$ ./swagger2slate.phar convert ../swagger.json -o source/index.md giving me the following PHP Warning: file_get_contents(../swagger.json): failed to open stream: No such file or directory in phar:///home/Desktop/swagger2slate.phar/index.php on line 15 |
@magdiel01 your Swagger definition fails validation, maybe that's it? Try {
"swagger": "2.0",
"info": {
"title": "My First API",
"version": "0.1"
},
"paths": {
"/api/resource.json": {
"get": {
"parameters": [
{
"name": "body",
"description": "Measure value object that needs to be added.",
"required": true,
"schema": {
"type": "array",
"items": {}
},
"in": "body"
}
],
"responses": {
"200": {
"description": "An example resource"
}
}
}
}
},
"definitions": {}
} Another (maintained) solution for converting Swagger (OpenAPI) to Slate is https://github.com/mermade/widdershins |
@MikeRalphson It fails because when I pasted the text into this thread it loses the indentation, |
@magdiel01 no problem. It isn't just the indentation though (that's optional for JSON / Swagger) - I've changed "name": "body",
"description": "Measure value object that needs to be added.",
"required": true,
"type": "array",
"items": {},
"paramType": "body" to "name": "body",
"description": "Measure value object that needs to be added.",
"required": true,
"schema": {
"type": "array",
"items": {}
},
"in": "body" You can check a Swagger definition is a valid at http://bigstickcarpet.com/swagger-parser/www/index.html |
"swagger2slate.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 927"
{
"swagger": "2.0",
"info": {
"title": "My First API",
"version": "0.1"
},
"paths": {
"/api/resource.json": {
"get": {
"parameters": [
{
"name": "body",
"description": "Measure value object that needs to be added.",
"required": true,
"type": "array",
"items": {},
"paramType": "body"
}
],
"responses": {
"200": {
"description": "An example resource"
}
}
}
}
},
"definitions": {}
}
The text was updated successfully, but these errors were encountered: