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

Can I use reference syntax for arbitrary text? #89

Closed
chriswu000 opened this issue May 19, 2014 · 3 comments
Closed

Can I use reference syntax for arbitrary text? #89

chriswu000 opened this issue May 19, 2014 · 3 comments

Comments

@chriswu000
Copy link

Hi all,

Thanks for a great project! I'm using apiary for our api docs and I'm loving it so far. Question though: I have a url root that I don't want to copy and paste every time I refer to it. Is there anyway to reference it within a Model? Something like this?

# Some section with references in it
    [DOC_ROOT]: "http://www.mydoc.com"

## Loan Instance [/loans/{id}]

+ Parameters
    + id (required, number, `42`)

+ Model (application/hal+json)

        {
            "documentation": "#{DOC_ROOT}/something_specific.html",
            "var1": 1
         }

So when we look at a response in the documention, we would see:

{
    "documentation": "http://www.mydoc.com/something_specific.html",
    "var1": 1
}

Thanks for your help.

@chriswu000 chriswu000 changed the title Can I use reference syntax for arbitrary text? Can I use reference syntax for arbitrary text? #Question May 19, 2014
@chriswu000 chriswu000 changed the title Can I use reference syntax for arbitrary text? #Question Can I use reference syntax for arbitrary text? May 19, 2014
@zdne zdne added the question label May 20, 2014
@zdne
Copy link
Contributor

zdne commented May 20, 2014

@chriswu000 This is currently not possible. I am trying to keep assets (markdown code blocks - or data "blobs" if you will) in API Blueprint atomic from the parser's point of view.

Otherwise you will have to escape some sequences in every asset which would lead to serious problems (remember its not only JSON out there).

Lately I have been thinking this might be possible by explicitly marking the assets that can (should) be expanded.

I would love to put more thoughts into this, so your feedback us much appreciated!

@zdne zdne mentioned this issue May 20, 2014
@chriswu000
Copy link
Author

@zdne Thanks for your reply. I'm just starting with api-blueprint as well as markdown, so I don't have any in depth opinions to provide. However, if I think of anything I'll be sure to let you know. Thanks again for a great product!

@zdne
Copy link
Contributor

zdne commented Oct 29, 2014

Currently there is no plan to add constructs to the language to define and reference arbitrary text. When it comes to HTTP message bodies, this should be addressed by the introduction of MSON into API Blueprint. See #117 (comment)

@zdne zdne closed this as completed Oct 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants