Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API docs #7429

Open
wants to merge 6 commits into
base: ats-api
Choose a base branch
from
Open

Update API docs #7429

wants to merge 6 commits into from

Conversation

ddippolito
Copy link
Contributor

Trello card URL

https://trello.com/c/c89aJ4g8/1447-documentation-of-api-for-users

Changes in this PR:

Add API documentation

Copy link

Review app deployed to https://teaching-vacancies-review-pr-7429.test.teacherservices.cloud on AKS

spec/swagger_helper.rb Outdated Show resolved Hide resolved
spec/swagger_helper.rb Outdated Show resolved Hide resolved
spec/swagger_helper.rb Outdated Show resolved Hide resolved
@@ -18,6 +18,44 @@
info: {
title: "Teaching Vacancies ATS API",
version: "v1",
description: <<~DESCRIPTION,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! 👏

@scruti
Copy link
Collaborator

scruti commented Jan 22, 2025

Nice. I left some suggestions for the current changes. Besides that there are 2 bits I would like to see added to the docs:

1. Put the docs behind user/password access.

So it doesn't get indexed by Google once it goes into production.
This can be configured on config/initializers/rswag_ui.rb (code to do so is commented). We need to set some user/password env variables for this config.

2. Changes in the vacancy API schema.

2.1 Extended descriptions/examples.

The vacancy schema needs to be extended so that every attribute in the schema has an example value & description.

Ideally, we would bring the "Purpose & Restrictions" info from the current V2 specification document as a "description" on the API schema fields.
The idea is to be sure that clients will understand what is the purpose of each field in plain English, and any restriction not reflected in the schema format.

This description will also be useful to indicate when we need "Choose one" or "One or more values from this list" besides the pure schematic formatting.

EG (the text is some random stuff for example):
expires_at: { type: :string, format: :date, example: "2025-03-13", description: "The end date of the vacancy. Must be after the start date." }
image

2.2 Schema inaccuracies.

Going through the fields, I noticed the schema needs to be updated to reflect our real restrictions.

Out of the scope of this PR, but we cannot start testing until we fix these. So happy to either fix them here or create a further ticket to address these:

So far noticed this one, but worth a double-check by multiple people in case I missed others:

  • expires_at needs to be moved to date-time format.
    An oversight when we defined the schema for the first time, but allowing them to set an expiration time for the vacancies is a functionality we currently provide and probably want to keep.

Copy link
Collaborator

@scruti scruti left a comment

Choose a reason for hiding this comment

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

Great improvements on the docs. LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants