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

Validate document structure #249

Merged
merged 14 commits into from
Mar 25, 2024
Merged

Conversation

millicentachieng
Copy link
Collaborator

@millicentachieng millicentachieng commented Jan 16, 2024

Validate document outline based on api page type.

Document outline config is in the below format:

{
  "apiPageType": [
    {
      "title": "",
      "level": 1,
      "required": true,
      "headers": [
        {
          "title": "Permissions",
          "level": 2,
          "required": true
        },
        {
          "title": "HTTP request",
          "level": 2,
          "required": true
        },
        {
          "title": "Path parameters",
          "level": 2,
          "required": false
        },
        {
          "title": "Function parameters",
          "level": 2,
          "required": false
        },
        {
          "condition": "OR",
          "arguments": [
            {
              "title": "Query parameters",
              "level": 2,
              "required": false,
              "headers": [
                {
                  "title": "OData query parameters",
                  "level": 3,
                  "required": false
                }
              ]
            },
            {
              "title": "Optional query parameters",
              "level": 2,
              "required": false
            }
          ]
        },
        {
          "title": "Request headers",
          "level": 2,
          "required": true
        },
        {
          "title": "Request body",
          "level": 2,
          "required": true
        },
        {
          "title": "Response",
          "level": 2,
          "required": true
        },
        {
          "title": "Examples",
          "level": 2,
          "required": true,
          "headers": [
            {
              "condition": "OR",
              "arguments": [
                {
                  "title": "Example *",
                  "level": 3,
                  "allowMultiple": true,
                  "required": true,
                  "headers": [
                    {
                      "title": "Request",
                      "level": 4,
                      "required": true
                    },
                    {
                      "title": "Response",
                      "level": 4,
                      "required": true
                    }
                  ]
                },
                {
                  "condition": "AND",
                  "arguments": [
                    {
                      "title": "Request",
                      "level": 3,
                      "required": true
                    },
                    {
                      "title": "Response",
                      "level": 3,
                      "required": true
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "title": "See also",
          "level": 2,
          "required": false
        }
      ]
    }
  ],
  "resourcePageType": [
    {
      "title": "* resource type",
      "level": 1,
      "required": true,
      "headers": [
        {
          "title": "Methods",
          "level": 2,
          "required": false
        },
        {
          "title": "Properties",
          "level": 2,
          "required": true
        },
        {
          "title": "Relationships",
          "level": 2,
          "required": false
        },
        {
          "title": "JSON representation",
          "level": 2,
          "required": true
        },
        {
          "title": "See also",
          "level": 2,
          "required": false
        }
      ]
    }
  ],
  "enumPageType": [
    {
      "title": "* enum type",
      "level": 1,
      "required": true,
      "headers": [
        {
          "title": "Members",
          "level": 2,
          "required": true
        }
      ]
    }
  ]
}

ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/ExtensionMethods.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/DocFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/DocFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/DocFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
ApiDoctor.Validation/Config/DocumentOutlineFile.cs Outdated Show resolved Hide resolved
@millicentachieng millicentachieng merged commit 1916d8c into master Mar 25, 2024
5 checks passed
@millicentachieng millicentachieng deleted the validateDocumentStructure branch March 25, 2024 13:08
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.

Optimize API reference docs validation process.
3 participants