Skip to content
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

Generation error on valid RAML file #2

Open
ddossot opened this issue Jun 3, 2015 · 6 comments
Open

Generation error on valid RAML file #2

ddossot opened this issue Jun 3, 2015 · 6 comments

Comments

@ddossot
Copy link

ddossot commented Jun 3, 2015

I'm trying to generate the doc for this RAML: https://api.unbounce.com/raml/v0.4/api.raml

Here is the error I get:

array(1) {
  ["schema"]=>
  string(3008) "{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","description":"Collection of account entities.","type":"object","additionalProperties":false,"required":["accounts","metadata"],"properties":{"accounts":{"type":"array","minItems":0,"uniqueItems":true,"items":{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","description":"TODO describe","type":"object","additionalProperties":false,"required":["created_at","id","metadata","name","options","state"],"properties":{"created_at":{"title":"Generic Date","description":"RFC 5322, section 3.4.1, compliant date, which means formatted with: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'","type":"string","format":"date-time","id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/common\/definitions_v2.0.json#\/date"},"id":{"type":"string"},"metadata":{"type":"object","allOf":[{"title":"Entity Metadata","type":"object","required":["location","documentation"],"properties":{"location":{"type":"string","format":"uri"},"documentation":{"type":"string","format":"uri"},"related":{"type":"object"}},"id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/common\/entities_v2.0.json#\/entity_metadata"},{"type":"object","required":["related"],"properties":{"related":{"type":"object","additionalProperties":false,"required":["pages","accounts","sub_accounts"],"properties":{"pages":{"type":"string","format":"uri"},"accounts":{"type":"string","format":"uri"},"sub_accounts":{"type":"string","format":"uri"}}}}}],"id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/metadata.json#\/account_metadata"},"name":{"type":"string"},"options":{"$schema":"http:\/\/json-schema.org\/draft-04\/schema#","type":"object","additionalProperties":false,"properties":{"api_keys_enabled":{"type":"boolean"}},"id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/account_options.json"},"state":{"type":"string","enum":["active","suspended"]}},"id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/account.json"}},"metadata":{"title":"Collection Metadata","type":"object","allOf":[{"title":"Entity Metadata","type":"object","required":["location","documentation"],"properties":{"location":{"type":"string","format":"uri"},"documentation":{"type":"string","format":"uri"},"related":{"type":"object"}},"id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/common\/entities_v2.0.json#\/entity_metadata"},{"type":"object","required":["count"],"properties":{"count":{"type":"integer"}}}],"id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/common\/entities_v2.0.json#\/collection_metadata"}},"id":"file:\/\/\/home\/ddossot\/dev\/projects\/ub-public-api-specs\/resources\/webroot\/raml\/v0.4\/schema\/accounts.json"}"
}
The key application/vnd.unbounce.api.v0.4+json does not exist.
phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php 333
#0 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(336): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#1 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(336): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#2 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(336): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#3 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(336): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#4 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(273): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#5 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(211): Raml\Parser->parseRamlData(Array, '/home/ddossot/d...', true)
#6 phar:///home/ddossot/dev/tools/raml2html.phar/src/Generator.php(55): Raml\Parser->parse('/home/ddossot/d...', true)
#7 phar:///home/ddossot/dev/tools/raml2html.phar/src/Command/GenerateCommand.php(62): Cnam\Generator->parse('/home/ddossot/d...')
#8 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Cnam\Command\GenerateCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Cnam\Command\GenerateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 phar:///home/ddossot/dev/tools/raml2html.phar/index.php(15): Symfony\Component\Console\Application->run()
#13 /home/ddossot/dev/tools/raml2html.phar(10): include('phar:///home/dd...')
#14 {main}
@cnam
Copy link
Contributor

cnam commented Jun 3, 2015

Hello, @ddossot

Your a use mediaType application/vnd.unbounce.api.v0.4+json that is not standard and does not pass validation.

This bug confirmed

If your change media type to application/json then generator will be correct working

@ddossot
Copy link
Author

ddossot commented Jun 3, 2015

Thanks for confirming the bug! Looking forward to a fix, I really like the design of the doc this tool generates 😄

@cnam
Copy link
Contributor

cnam commented Jun 3, 2015

Hello, @ddossot

We have released version 0.0.4 can be downloaded from the link,

http://raml2html.leanlabs.io/raml2html.phar

@ddossot
Copy link
Author

ddossot commented Jun 3, 2015

Thanks!

Here is the error I receive now:

Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
PHP Notice:  Undefined index: application/vnd.unbounce.api.v0.4+json in phar:///home/ddossot/dev/tools/raml2html-0.0.4.phar/vendor/cnam/php-raml-parser/src/Parser.php on line 331
PHP Fatal error:  Call to a member function setSourceUri() on a non-object in phar:///home/ddossot/dev/tools/raml2html-0.0.4.phar/vendor/cnam/php-raml-parser/src/Parser.php on line 332

@cnam cnam closed this as completed in f4baeb4 Jun 3, 2015
@cnam cnam reopened this Jun 3, 2015
@cnam
Copy link
Contributor

cnam commented Jun 3, 2015

I am sorry, please try again.

http://raml2html.leanlabs.io/raml2html.phar

@ddossot
Copy link
Author

ddossot commented Jun 3, 2015

Thank you 👍 I get a different error now:

Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: key: application/vnd.unbounce.api.v0.4+json not found from accept types application/json,text/json,application/(.*?)+json
Warning: Not valid json or file not found.
JSON:'page_group'
Invalid JSON.
phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Schema/Parser/JsonSchemaParser.php 46
#0 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(340): Raml\Schema\Parser\JsonSchemaParser->createSchemaDefinition('page_group', '/home/ddossot/d...')
#1 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(342): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#2 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(342): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#3 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(342): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#4 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(342): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#5 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(342): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#6 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(273): Raml\Parser->recurseAndParseSchemas(Array, '/home/ddossot/d...')
#7 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/cnam/php-raml-parser/src/Parser.php(211): Raml\Parser->parseRamlData(Array, '/home/ddossot/d...', true)
#8 phar:///home/ddossot/dev/tools/raml2html.phar/src/Generator.php(55): Raml\Parser->parse('/home/ddossot/d...', true)
#9 phar:///home/ddossot/dev/tools/raml2html.phar/src/Command/GenerateCommand.php(62): Cnam\Generator->parse('/home/ddossot/d...')
#10 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Cnam\Command\GenerateCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Cnam\Command\GenerateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 phar:///home/ddossot/dev/tools/raml2html.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 phar:///home/ddossot/dev/tools/raml2html.phar/index.php(15): Symfony\Component\Console\Application->run()
#15 /home/ddossot/dev/tools/raml2html.phar(10): include('phar:///home/dd...')
#16 {main}

You can check the API Console for my RAML file here: https://api.unbounce.com/console.html It may help you debug the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants