Open ghost opened 9 years ago
Does anyone have this working? I feel like I'm missing something as being able to describe what the request data looks like seems so fundamental to all of this I can't figure out how it's gone overlooked this long. Apiary does an OK job of rendering the attributes sections, but I'm not sure the cloud hosted model is going to work for my production needs.
Tried installing the beta referenced above, but that went all sorts of sideways and I'd expect those changes would have been merged into the master branch at this point anyway.
Appreciate any guidance here. This is what I'm trying to get to render out. I realize that the MSON doesn't support url encoded yet so I'll have to provide the body which is fine. Need the attributes to be displayed though. Hoping to see them look basically like the Parameters section used on the GETs
Thanks!
### Do something awesome [POST]
+ Attributes
+ message (string) - The message
+ author: boba@fett.com (string) - Author of the message
+ Request (application/json)
+ Request (application/x-www-form-urlencoded)
+ Body
message=foo
+ Response 200
+ Headers
Location: ID
Seems the related issue has been closed https://github.com/apiaryio/api-blueprint/issues/191. Any news on this one? Cheers
This has been an issue for me .. for the entirety of this issue being open. Is aglio being supported these days?
I am really waiting this feature.
Hey @danielgtaylor! Not to pointlessly bump you, but this is a big awesome feature that a lot of folks are looking forward to. Could you give us an update? π
@philsturgeon and everyone else on this thread, I am very sorry this is not implemented yet. Apiary has kept me extremely busy these last few months and I could not justify spending the time on Aglio. Today is my last day at Apiary. Once I have stable employment again, I hope to work on some new features for Aglio, but right now my focus needs to be elsewhere. I hope you can understand.
P.S. If anybody reading this is hiring either remote or in Seattle, please reach out: danielgtaylor@gmail.com
Hey @danielgtaylor, thanks for getting back to me! Sorry to hear that, I just had a job swap that took a bit longer than I hoped and it can be a f**ker on the money. Pop on the http://slack.apisyouwonthate.com and we'll see if anyone in there is looking, or we can tweet something from the channel. It's got some eyes on it.
In the meantime, maybe you could add https://pledgie.com/ to this repo? I would certainly throw some money at you, and I'm sure some of the other 30ish participants in here would too. Maybe that would help get this feature up and running.
If not, I'll try and get you a PR, but I'm rammed myself. Isn't everyone. π
+1
π
π Can't wait for this feature :)
+1 I'm really looking forward to this feature. What time could the agilo support this.? @danielgtaylor
@bniwredyc, I really like how you present the attributes as a table. Currently, I'm struggling to use your fork. Are there any tutorials to have this custom theme? So far, the steps I took were:
Results: created a node_module folder
Please let me know if I am missing any steps. Thank you
@angmark0309 have you configured aglio in your Gruntfile?
@bniwredyc So inside my node_module I only seeaglio-theme-kaiten
directory and inside that, the following files Changelog.md cache node_modules scripts styles README.md lib package.json src templates
No Gruntfile. I think I'm installing the fork incorrectly since Im fairly new to this.
@bniwredyc Your solution look so nice. and could you send a pull request to the repository in order to help us to use it?
@angmark0309 I actually don't know how to use themes without grunt-aglio https://www.npmjs.com/package/grunt-aglio
@ryanchou1991 done. Not that I think it will be merged (there are some other changes), but still.
@bniwredyc Awesome job. I would try your solution later. I'm so appreciated for that you could offer that solution. Before I saw your comment. I have used markdown table sheet to instead of the attributes. While it couldn't be compatible with blueprint syntax very well.
@bniwredyc - you dont have a triple.jade version by any chance, do you?
For me I've ended up with attributes in description for now
<?php
/**
* Add product
*
* **Body Attributes:**
*
* | name | type |
* | --- | --- |
* | some | some |
*
* @Post("/")
* @Versions({"v1"})
* @Transaction({
* @Request({
* "name": "Some project",
* "domain": "some.github.com"
* }),
* @Response(200, body={}),
* @Response(422, body={})
* })
*/
@angmark0309
npm install kaiten-hq/aglio-theme-kaiten -g
aglio --theme-template /usr/local/lib/node_modules/aglio-theme-kaiten/templates/index.jade
π
I made a little progress! One of the folks on slack.apisyouwonthate.com gave me a snippet, which I've expanded to make attributes show in our own custom theme.
In mixins.jade I replaced the JSON Schema output and added this new mixin:
if request.schema
- var schema = JSON.parse(request.schema)
h5.attributes-title Attributes
+AttributeTable(schema)
mixin AttributeTable(schema)
table.attributes-list(style="width: 100%;")
thead.attributes-header
each props, name in schema.properties || []
tr
td
strong= self.urldec(name)
td.attribute-type
!= props.type ? (props.enum ? 'enum' : props.type) : 'string'
td
if schema.required && schema.required.indexOf(name) >= 0
span.required-field (required)
else
span.optional-field (optional)
td
ul
if props.default
li.text-info.default
strong Default:
span= props.default
if props.example
li.text-muted.example
strong Example:
span= props.example
if props.enum
li.choices
strong Choices:
ul
each value in props.enum
li
code= self.urldec(value)
= ' '
if props.description
tr
td
td(colspan=3)
em
!= self.markdown(props.description)
if props.items
tr
td(colspan=4)
div.nested-attributes
+AttributeTable(props.items)
if props.properties
tr
td(colspan=4)
div.nested-attributes
+AttributeTable(props)
It works with nested attributes, and with a little CSS on it, it looks... ok well it looks terrible but its good enough to get this task off my desk for now.
Obviously im no designer.
Can somebody do something with this? Nicen it up and make a PR to aglio themes?
@philsturgeon thx for your code snippet! Im trying it to use for arrays, like in:
###User
+ id: 123 (number)
+ `communication_methods` (array[CommunicationMethods])
The snippet won't work because props.items
or props.properties
is empty in the AttributeTable mixin.
Your script solves the problem in the template by adding recursiveness, but the data isn't coming from aglio (in case of arrays). Did you solve this?
I did not! Honestly I use Open API and ReDoc these days, it's solved this sort of problem for me.
-- Phil Sturgeon Sent from my iPhone and there's probably typos because I'm probably cycling
On Aug 21, 2017, at 13:40, 11mb notifications@github.com wrote:
@philsturgeon thx for your code snippet! Im trying it to use for arrays, like in:
User
- id: 123 (number)
communication_methods
(array[CommunicationMethods])` The snippet won't work because props.items or props.properties is empty in the AttributeTable mixin.Your script solves the problem in the template by adding recursiveness, but the data isn't coming from aglio (in case of arrays). Did you solve this?
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
It looks like https://github.com/danielgtaylor/aglio/pull/337 solves this issue perfectly, but Travis is failing and there's no commit activity. Hopefully somebody picks it up.
it could really be helpful
Aglio looks fantastic but I have problems rendering complex cases as such:
I have this file: https://raw.githubusercontent.com/samwiseapi/apiary-samwise/master/apiary.apib
where I got a) "attributes" sections such as
b) custom Data Structures such as (note the SampleProperties which is itself a custom Data Structure)
when I run the file agains aglio, these parts are ignored apparently. Would it be possible to add rendering to aglio for these?
apiary.io renders Attribute section as a table and does not have Data Structures and nested data structures render working but there are plans http://stackoverflow.com/questions/29848375/apiblueprint-structures-to-achieve-desired-description/29901429#29901429 - check here. I though like aglio design more.