TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Back-end team does not document their APIs. How do I convince them?

7 点作者 ameesdotme超过 8 年前
I&#x27;ve been working at a SaaS-company for about half a year as a front-end developer, the product has been in production for about 3 years. The codebase has always been quite messy, because many engineers worked on it without any guidelines or even linting.<p>In the past months, the front-end team worked on a new application that is well documented and maintainable. This resulted in the need of two new APIs.<p>This resulted in an exchange of JSON-files over email, rather than a proper API-documentation. I am currently in the process of trying to convince the product-owner to allocate time for this, as I&#x27;m quite disappointed about the total lack of docs.<p>Do you have any tips on how to take this on?

10 条评论

whataretensors超过 8 年前
One of the hardest things to do is choosing the right battles. Ask, is this worth it? If it&#x27;s an API integration point primarily for internal use I wouldn&#x27;t insist on it. If the API is changing too much right now that documentation would quickly become obsolete, I wouldn&#x27;t worry about it. It might be easier and cheaper to get a backend engineer to answer your questions.<p>If you are expecting clients to integrate with your backend without documentation, and you do not have an enterprise-level agreement, then it would be a deterrent for integration on most teams. Making that case should be straightforward. More documentation would mean more adoption, which means more value for the company.
评论 #12686602 未加载
tedmiston超过 8 年前
Besides convincing your backend team that sharing how to communicate with the API in a structured way is important, one bit of advice in general is to make it easy.<p>One way to make API documentation easy is to generate it from code rather than write a doc manually. This can pull from class and method comments to add description to your endpoints (if those comments exist and are relevant), but even if they aren&#x27;t there you&#x27;ll still have access to the endpoints and the input&#x2F;output.<p>I&#x27;m not sure what your tech stack is but here&#x27;s an example using Django w&#x2F; Django Rest Framework. You can use Swagger [1] for docs &#x2F; a browsable interface to the API. Then you can use an integration like Django Rest Swagger [2] to automate most of the work.<p>[1]: <a href="http:&#x2F;&#x2F;swagger.io" rel="nofollow">http:&#x2F;&#x2F;swagger.io</a><p>[2]: <a href="http:&#x2F;&#x2F;marcgibbons.github.io&#x2F;django-rest-swagger&#x2F;" rel="nofollow">http:&#x2F;&#x2F;marcgibbons.github.io&#x2F;django-rest-swagger&#x2F;</a>
评论 #12690107 未加载
评论 #12687525 未加载
HillRat超过 8 年前
Everything comes down to time and budget. Assuming you have a project budgeting model, make sure that for every project you add in estimates for analyzing, documenting, and integrating the backend layer, and call it out specifically as a result of insufficient documentation. What you&#x27;re trying to do is get someone up the managerial food chain to ask, &quot;Why are we paying developers to do this for every project, when we could document this once and be done with it?&quot;<p>To put it another way, you&#x27;ll never have enough leverage to talk another business unit into spending their time and money to solve your problems. You need to make your problem someone else&#x27;s -- someone with the ability to force the solution.
fatdog超过 8 年前
There is a cultural problem in some orgs where some (even sr.) devs think not documenting things creates job security, but it really just creates bottlenecks that suffocate the organization. Few things signal a corporate death spiral like the phrase, &quot;useless documentation.&quot; This means that nobody is going to read it, because nobody cares, and nobody cares because it&#x27;s probably crap. GIGO. A product of shitty thinking.<p>The only real value of any software is that it does what someone says it does, and if nobody says it does anything, then I would argue it is not creating value for anyone. It is showing up to work and consuming resources, but it&#x27;s not moving the company anywhere.<p>Growth in a company means building things that are the foundation for something else, and those foundations are based on the assurances of people with credible word. Documentation creates a basis for that credibility. A lack of credibility means a lack of ability to deliver value.<p>If your backend devs won&#x27;t document their APIs as a matter of backward principle, your company is probably in a death spiral, fire them or eject.
afarrell超过 8 年前
&#x2F;r&#x2F;whataretensors is correct that you have to pick your battles. However, if you&#x27;re asking us then I&#x27;m going to assume that the lack of documentation is slowing you down enough that it is in your company&#x27;s interest for docs to get written. Lack of docs puts timely product delivery at risk.<p>What are the product-owner&#x27;s overall goals? You should tie documentation to that. In a healthy organisation, the product-owner&#x27;s goals will either be already pretty clear or they&#x27;ll be actively working on making them clear. If they aren&#x27;t clear to you then do a quick check through emails&#x2F;minutes&#x2F;retrospectives to see if you&#x27;ve missed something and ask for a half hour on their calendar to seek clarity. Take the bulk of that time to listen[1] to what their priorities and stressors are. Pay particular attention to where your work fits into that. If your work actually <i>doesn&#x27;t</i> fit into that then you&#x27;ve got a bit of an organisational incentives problem. Assuming it does, then make your case that documentation in a canonical place (even if it is those same json files and some comments) is not a nice-to-have but a need-to-have for frontend to deliver what the product owner needs.<p>For all of this, I&#x27;ve assumed that the product owner for the backend and frontend is the same person. If it is two different people, then you might have a conflict of incentives that needs to be fixed: The backend team has little&#x2F;no incentive to help the frontend team. If that is the case, then you should have a chat with the product owner of the frontend team because that is an organisation-level problem and some incentives will need to get re-aligned.<p>[1] <a href="https:&#x2F;&#x2F;hbr.org&#x2F;2016&#x2F;07&#x2F;what-great-listeners-actually-do" rel="nofollow">https:&#x2F;&#x2F;hbr.org&#x2F;2016&#x2F;07&#x2F;what-great-listeners-actually-do</a>
new_hackers超过 8 年前
I would think long and hard about the following questions:<p>What are your expectations?<p>What is the minimum possible that could be done to meet your expectations?<p>What deficiencies currently exist that are blocking you?<p>Once you have this written down, only then should you approach the other party. Remember YOU think it is &quot;messy&quot; &quot;lacks docs&quot;, however others may think it is fine. You will not win any friends by demanding someone does more work that they don&#x27;t consider to be worthwhile.<p>If you have no leverage, then you are asking for a favor.<p>Be nice, be friendly and courteous. Try to see the other person&#x27;s viewpoint.<p>Good luck in your negotiation.
cdnsteve超过 8 年前
I&#x27;ve often found if you lead the effort yourself, and then ask for their input, this usually works well. If you wait for someone else to take the first step, it&#x27;s usually not going to happen.<p>Start by creating a Github wiki for documentation for both front-end and back-end API&#x27;s. Add them as collaborators, or create them right inside each existing repo if you can. Populate the back-end one as best you can to your knowledge, then ask for them to validate.<p>I always think of documentation as a note to my future self. In X months, what won&#x27;t I remember?
评论 #12686475 未加载
iddogino超过 8 年前
I&#x27;d argue that this should go the other way around. Your developers should be creating the &#x27;docs&#x27; - the API design and boilerplate, before programing it. If they actually sit down and design the API before setting of to write the code you&#x27;ll end up with: (a) the documentation you want. (b) an API that this designed consistently and consciously. Would you let your front end developers build something without at least a wire frame &#x2F; functional design?
评论 #12686902 未加载
rxbudian超过 8 年前
If it&#x27;s just an internal use, you can ask them to have tests build against the endpoints and use that as a way to document how to use them. It&#x27;s better than nothing, and they&#x27;re technically code, so it&#x27;s in their domain to build.
samblr超过 8 年前
what is the language &amp; middleware&#x2F;framework used in backend ?
评论 #12686854 未加载