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

Tcm 5257 summarize issues with swagger api documentation for creating sdk #246

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

DmitryMasley
Copy link

@DmitryMasley DmitryMasley commented Oct 14, 2024

  • Updated CLI tooling for swagger
  • Updated test script to validate and lint the documentation
  • Fixed outstanding errors, prevented build
  • HTML file now generated by the CLI itself, no need to hard code it

npm run test script will show linting errors. npm run test -- --format=stylish will produce a more compact output grouped by file

Preview link

Copy link
Contributor

@dimitrystd dimitrystd left a comment

Choose a reason for hiding this comment

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

👍

@@ -114,7 +114,7 @@ components:
content:
application/json:
schema:
$ref: '#/components/schemas/Error400Response'
$ref: '../api_common.yaml#/components/schemas/Error400Response'
Copy link
Author

Choose a reason for hiding this comment

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

I assume api_common.yaml is a most common description of the response

defaultLocaleId:
type: string
description: Smartling's default locale that corresponds to languageId
properties:
Copy link
Author

@DmitryMasley DmitryMasley Oct 14, 2024

Choose a reason for hiding this comment

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

object should have properties attribute

@@ -8,10 +8,6 @@ x-paths:
tags:
- File Machine Translations (MT)
operationId: mtFile
consumes:
Copy link
Author

Choose a reason for hiding this comment

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

consumes and produces no longer exist in openapi v3

Copy link
Author

Choose a reason for hiding this comment

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

consumes was replaced by requestBody and produces described in responses

@@ -45,6 +45,8 @@ components:
schemas:
GetGlossaryEntriesByFilterCommandPTO:
type: object
required:
- entryState
Copy link
Author

Choose a reason for hiding this comment

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

required fields of the object described in the separate array field required


externalDocs:
description: Smartling Help Center
url: 'https://help.smartling.com'

security:
- BearerAuth: []
Copy link
Author

Choose a reason for hiding this comment

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

I assume all the API is using BearerAuth. Please, correct it if it is wrong.

@@ -3827,85 +3830,85 @@ paths:
# Issues API endpoints
#
/issues-api/v2/dictionary/issue-states:
$ref: './spec/issues/dictionaries.yaml#/x-paths/dictionary_issues_states'
Copy link
Author

Choose a reason for hiding this comment

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

reference relative to the file, rather than the root of the project.

@@ -11811,7 +11832,7 @@ components:
description: The text to translate
example: Text to translate
type: string
maxLength: 64kb
Copy link
Author

Choose a reason for hiding this comment

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

maxLength can only be number

@@ -11548,7 +11563,7 @@ components:
description: >-
Whether translator instructions have been captured for the
file
type: integer
Copy link
Author

Choose a reason for hiding this comment

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

description indicates it is boolean

@DmitryMasley
Copy link
Author

FileType enum is declared multiple times in documentation for different APIs. It is inconsistent. Likely we need to define it once and reuse in all the APIs.

@DmitryMasley
Copy link
Author

Very common lint error: schema does not match examples. In many cases, the schema is defined incorrectly. Sometimes arrays are defined where there has to be an object, sometimes, an object is defined in place of an array.

@DmitryMasley
Copy link
Author

DmitryMasley commented Oct 14, 2024

@AlexArcher idk what process-yaml is doing. It was designed for TQC, but changes that script introduces are breaking the build.

Edit:
It was fixed in #257 (review)

dimitrystd and others added 2 commits October 23, 2024 18:05
* JOBSBATCH-213 #251 #252 Partially fixed warnings in the Batch API

* JOBSBATCH-213 #251 #252 Fixed warnings in the Batch API

---------

Co-authored-by: Loparev <[email protected]>
Tqct 1058 fix issues and TQC warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants