Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Attributes description #135

Merged
merged 37 commits into from
Mar 30, 2015
Merged

Attributes description #135

merged 37 commits into from
Mar 30, 2015

Conversation

zdne
Copy link
Contributor

@zdne zdne commented Nov 13, 2014

For review ONLY – do not merge

This Pull Request proposes the way to describe Resource, Action and arbitrary message-body attributes in a reusable way. It also proposes the introduction of "data dictionary" to API Blueprint. In addition changes in this PR suggest that, if a message-body data structure is fully described using the attributes description, an explicit example asset (e.g. a JSON blob) is not needed and can be omitted from a blueprint.

Please read (and review) following examples:

Also, in particular, read (and review) following sections of API Blueprint Specification


Update

Added description of Attributes section in


This PR closes #25

@L42y
Copy link

L42y commented Nov 14, 2014

🚢 it

@L42y
Copy link

L42y commented Nov 14, 2014

can we have this feature in the beta area, like the "New Documentation"?


+ attributes (object)
+ id: 250FF (string)
+ object: coupon (string, fixed)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would something other than object be better here, as object is used as a type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, its a property in of the JSON, this example was taken from the Stripe API, see the JSON blob just bellow (https://github.com/apiaryio/api-blueprint/pull/135/files#diff-4a00d27e65fcbd5e907cb2fa3dec6111R36)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was mainly meaning for clarity purposes. Talking about objects and then using an object as a string could be unclear in some situations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a little note saying that just because object is used to describe a type, there is no prohibition against using it as a property name.

@pksunkara
Copy link
Contributor

@zdne My review is done. Looks very good. Please resolve my comments. Thanks.

@zdne
Copy link
Contributor Author

zdne commented Nov 21, 2014

Addressed review comments. Proceeding with updating resource and action sections.

@zdne
Copy link
Contributor Author

zdne commented Nov 21, 2014

Hey @L42y, once available in Apiary, this will be (most likely) directly part of the blueprint editor and documentation, no need to switch it on in the beta area.

@pksunkara
Copy link
Contributor

👍 Looks good.

@zdne
Copy link
Contributor Author

zdne commented Nov 21, 2014

Added attributes to Resource and Action sections, please review c785fef

@pksunkara
Copy link
Contributor

The text looks good. Just a minor question about consistency.

@pksunkara pksunkara force-pushed the zdne/attributes-description branch from 7594468 to 0151a55 Compare March 23, 2015 13:10
* `Values` is the **optional** enumeration of possible values
* and `<enumeration element n>` represents an element of enumeration type.
* `<type>` is the **optional** parameter type as expected by the API (e.g. "number", "string", "boolean"). "string" is the **default**.
* `Members` is the **optional** enumeration of possible values. `<type>` should be surrounded by `enum[]` if this is present. For example, if enumeration values are present for a parameter whose type is `number`, then `enum[number]` should be used instead of `number` to.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra to.

pksunkara added a commit that referenced this pull request Mar 30, 2015
@pksunkara pksunkara merged commit 4b678e9 into master Mar 30, 2015
@pksunkara pksunkara deleted the zdne/attributes-description branch March 30, 2015 13:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Message-body Attributes Description
9 participants