Nic*_*ans 5 rest standards w3c github web-standards
我们想要记录一个标准的REST API接口,该接口将由许多供应商实现.目前,我们正在使用Google文档来存储规范.
要求(对大多数人来说必须是共同的):
通过一些研究,有一些相关的标准组织:
IETF(Internet工程任务组):主要使用基于文本的RFC格式,但似乎有一些不错的跟踪工具.通常对于较低级别的标准(例如TCP),尽管它们也创建了更高级别的标准.
OASIS(结构化信息标准促进组织):似乎更多是关于IETF/W3C标准之上的业务抽象.
我在网上看了几个例子,并注意到方法的不同之处:
JSON-LD:规范历史,在GitHub中版本化,关于GitHub, W3C从属关系的问题,使用 ReSpec(也在 GitHub上).
JSON API:规范历史,在GitHub中版本化,GitHub上的问题,没有明显的从属关系,似乎使用Jekyll和一些自定义模板.
HTML 5(W3C):在GitHub中版本化,GitHub上的问题, W3C从属关系,使用 Bikeshed.
HTML 5(WHATWG):在GitHub中进行版本化,GitHub上的问题, WHATWG从属关系,使用"专有语言,然后将其后处理成HTML"(源代码).
JSON Schema:使用IETF工具进行版本化, GitHub上的问题, IETF从属关系,使用 IETF RFC格式.
对于REST API,我们应遵循哪种方法?各有哪些优缺点?
鉴于它是基于 REST 的 API,W3C 是最相关的。WHATWG 过于关注 HTML,IETF 会导致规范可读性较差,并且 OASIS 可能过于晦涩难懂。
\n所有机构都同意RFC2119,因此值得确保在规范中使用它。
\n如果选择 W3C,则必须遵循Pubrules (有一个新的W3C pubrules 验证器,可通过 npm 和此处访问)。目前流行两种主要格式/工具,均受 W3C 工具的支持,如下所述:
\n\n\nReSpec and Bikeshed: Since W3C "pubrules" markup can prove repetitive and at times hard to get right, many tools have been developed to assist people in producing it \xe2\x80\x94 these are the two main ones. ReSpec documents are essentially valid HTML with some extra configuration that a JS library turns into the real thing; Bikeshed is a Python preprocessor that can apply to HTML but is more often used in Markdown mode.
\n
N.B. Anolis, an older preprocessor that preceded ReSpec and Bikeshed, has been declared dead by it\'s author.
\nW3C is currently undergoing a process of modernisation. A new W3C project named Echidna (based in GitHub) supports both ReSpec and Bikeshed automated publishing, though the latter has only recently been implemented, and it currently only works inside the W3C.
\nUsing either of the above tools will allow the standard to be indexed in specref.org (the database of bibliographical references that W3C specifications rely upon).
\nNotes on each of these options:
\nBoth ReSpec and Bikeshed have a feature to link GitHub issues to inline issues in the spec, which mean they pair well with GitHub. All examples found just use commit logs for versioning.
\nIn terms of community:
\nW3C 社区团体似乎是吸引更广泛受众的好方法,他们建议使用 GitHub 进行“现代标准开发”(以及 ReSpec,尽管该建议可能已经过时)。
\nWeb孵化器 CG是 W3C 社区组的一个更加非正式的版本,它提供了一个现有的社区、GitHub和论坛来讨论与“Web 平台”直接相关的主题(这意味着仅对“Web 平台功能”有用)在浏览器或类似的用户代理中实现“)。他们同时使用 ReSpec 和 Bikeshed。
\n 归档时间: |
|
查看次数: |
711 次 |
最近记录: |