Closed TimGoodwill closed 3 years ago
Thanks @TimGoodwill for the comprehensive feedback. I will attempt to break this down into a number of smaller issues that the working group can consider for incorporation into the standard.
The next working group meeting is in January, so I will aim to have a few proposed changes in PR form prior to then.
Thanks for your response. I am happy for you to close this issue and manage the feedback as individual issues, or in the context of the Working Group - whichever suits.
Whilst the baseline Victorian standard is very comprehensive, and we have borrowed from it quite a bit, the Department of Home Affairs’ REST API standard differs from that of the Victorian standard in a number of key areas where the standard is silent, or problematic for federal government and Home Affairs portfolio APIs.
Major points
Minor points with interoperability ramifications
Other Feedback - language issues and unhelpful constraints
Specifying OpenAPI version 2.0 is unhelpful. We require developers to produce an OpenAPI version 3.0 spec wherever possible, but will support v2.0 when backend technology constrains choice. V3.0 was introduced in July 2017.
Preferencing snake_case over camelCase is an odd choice, and unnecessary. Preference will largely come down to the technology stack – CamelCase for Java/JavaScript and snake_case for Python/Ruby. In terms of common usage, the weight is with camelCase at this point in time. We use camelCase rather than snake_case for member/field names and query parameter names. As per the JSON-API, restfulapi.net, google and Microsoft guidance and JavaScript standard convention (https://www.w3schools.com/js/js_conventions.asp).
Our department’s API strategy is heavily predicated on Domain Driven Design, which is not mentioned in the Victorian standards document. Statements in the Victorian standards doc such as ‘APIs should be customer centric’ (‘API as a Product’ section), in the absence of an overarching Domain Driven Design context could definitely lead in the wrong direction. We have nuanced this statement in our policy.
The abstraction matrix (abstraction section) is unnecessary. The ‘Basic’ level of abstraction would not be acceptable in a federal government department. Statement that has been applied to ‘Intermediate’ levels of abstraction, “NEVER directly expose the internal database table structure as is in your API” and “avoid exposing and sharing internal system identifiers”, and statements applied to the ‘advanced’ level of abstraction, namely the use of an API gateway and HATEOAS, should ideally apply to all resource APIs published within a federal department.
The Victorian API lifecycle attempts to be a little more all-encompassing than is necessary or helpful. We have:
Our error structure is similar, but ‘extended’ to include additional data such as ‘helpUrl’ (more information on the error) and ‘location’ (part request part that predicated the error). A base schema across fed gov would be useful, however allowing extensions to the schema allows a degree of tailoring to the needs of a specific environment.
Rate-limiting headers are API Management platform specific, and should not be prescribed. Ours follow the format ‘x-ratelimit-reset’ rather than ‘X-Rate-Limit-Reset’ as per the Victorian document.
Please consider.