Comments (9)
After much scratching-of-the-head over some really odd behavior (data structures with child attributes displaying as siblings, disappearing sections, etc) when using 2-space indentation, I think we should make it a general rule to indent all things with 4 spaces. Itโs how they format indents in their examples. Switching to 4-space indentation led to much more predictable behavior.
from deprecated-code-corps-rails-api.
It would be good to clarify where in the API spec you're sourcing the conventions, and also to look through our existing blueprint to see what other types of objects we're missing from your example that would be renamed.
This process won't catch every edge case right now, but we at least have a good pool of real-world examples from our own project to discuss in the course of this conversation.
from deprecated-code-corps-rails-api.
@joshsmith what do you mean by clarify where in the API spec I'm sourcing the conventions? Like where did I come up with the convention?
In that case, the double spacing came from #458.
As for other types of objects, the kinds I'm seeing are:
Errors (conflict, 4xx errors like not found, etc)
OAuth Grant
Maybe it would be good to separate out the resource
data structures from these other more generic structures?
from deprecated-code-corps-rails-api.
A little late to the conversation, but I love where this is going. Good call on mirroring json-api, makes a lot of sense ๐
from deprecated-code-corps-rails-api.
๐ For me as well. I wen't a bit overboard with objects in my PR. This is a nice balance and the naming is clear.
The only trouble I'm seeing (and I'm having that in my PR as well, are "reduced" objects we use in requests. For example, in a POST request, our Comment Resource
- does not have an ID
- it only supports and requires the "markdown" attribute. Nothing else can be assigned by the user. If we add more attributes, the API wont fail, but those will be ignored
- it only supports and requires the post relationship. user relationship is ignored and assigned as current user API-side, as are comment user mentions
Any ideas on how we might be able to handle that in a nice way? I guess if there's little repetition of cases like that, we can just create them individually for now.
from deprecated-code-corps-rails-api.
In case anyone else comes across this: if you have an attribute with an underscore _
and its value also has an underscore _
, the example text wonโt render correctly in the UI. Hereโs an example:
+ state_transition: `signed_up` (string, optional)
The output will look something like this:
Instead, you have to escape the attribute name with backticks, like this:
+ `state_transition`: `signed_up` (string, optional)
โฆso that it renders properly:
This was discussed in apiaryio/api-blueprint#224 (comment)
from deprecated-code-corps-rails-api.
@begedin doesn't the comment resource have an id
due to include Comment Resource Identifier
?
from deprecated-code-corps-rails-api.
@begedin I think we handle individually now at cost of repetition and break it down further if needed.
from deprecated-code-corps-rails-api.
Does someone want to take on adding documentation for this in a pull request, or possibly just adding this to the wiki to save some time?
from deprecated-code-corps-rails-api.
Related Issues (20)
- Document User Categories API HOT 1
- Document User Roles API
- Document User Skills API
- Document Users API HOT 1
- Clarify that bin/setup must be run in new terminal window
- Find a way to deploy branch commits HOT 2
- Add ability to assign tasks HOT 1
- Reference GitHub repositories in a project HOT 1
- Reference GitHub repositories in a post HOT 1
- Add project updates to projects HOT 1
- Add GitHub authentication HOT 1
- Connect GitHub repositories to projects HOT 1
- Add the ability to push to Apiary in Circle HOT 2
- Documentation - Issue with credential exchange
- Change wording in role skills
- Make changes suggested by API Blueprint linter
- Find better way of documenting coalesced ids
- Rework User Skills and Role Skills to remove "join table" references
- Fix project#create to respond according to JSON API spec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deprecated-code-corps-rails-api.