osunyorg/admin

View on GitHub
openapi/osuny/v1/openapi.json

Summary

Maintainability
Test Coverage
{
  "openapi": "3.0.1",
  "info": {
    "title": "Osuny",
    "version": "v1"
  },
  "servers": [
    {
      "url": "/api/osuny/v1"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "security": [
    {
      "api_key": [

      ]
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "X-Osuny-Token",
        "in": "header"
      }
    }
  },
  "paths": {
    "/communication/websites/{website_id}/posts": {
      "get": {
        "summary": "Lists the posts in a website",
        "tags": [
          "Communication::Website::Post"
        ],
        "parameters": [
          {
            "name": "website_id",
            "in": "path",
            "description": "Website identifier",
            "example": "6d8fb0bb-0445-46f0-8954-0e25143e7a58",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": [
                      {
                        "id": "c8a4bed5-2e05-47e4-90e3-cf334c16453f",
                        "title": "Référentiel général d'écoconception de services numériques (RGESN)"
                      }
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "equired": [
                    "name",
                    "url"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Creates a post",
        "tags": [
          "Communication::Website::Post"
        ],
        "parameters": [
          {
            "name": "website_id",
            "in": "path",
            "description": "Website identifier",
            "example": "6d8fb0bb-0445-46f0-8954-0e25143e7a58",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": [
                      {
                        "id": "c8a4bed5-2e05-47e4-90e3-cf334c16453f",
                        "title": "Référentiel général d'écoconception de services numériques (RGESN)",
                        "published": true,
                        "published_at": "TODO"
                      }
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "title"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Title",
                    "example": "This is a post"
                  },
                  "summary": {
                    "type": "string",
                    "description": "Summary",
                    "example": "This is a summary"
                  },
                  "migration_identifier": {
                    "type": "string",
                    "description": "Unique migration identifier"
                  },
                  "published": {
                    "type": "boolean",
                    "example": false
                  },
                  "locale": {
                    "type": "string",
                    "description": "Locale",
                    "example": "fr"
                  }
                },
                "required": "title migration_identifier"
              }
            }
          }
        }
      }
    },
    "/communication/websites/{website_id}/posts/{id}": {
      "get": {
        "summary": "Shows a post",
        "tags": [
          "Communication::Website::Post"
        ],
        "parameters": [
          {
            "name": "website_id",
            "in": "path",
            "description": "Website identifier",
            "example": "6d8fb0bb-0445-46f0-8954-0e25143e7a58",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Post identifier",
            "example": "84722b61-f7c3-43c5-9127-2292101af7c5",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": [
                      {
                        "id": "c8a4bed5-2e05-47e4-90e3-cf334c16453f",
                        "title": "Référentiel général d'écoconception de services numériques (RGESN)"
                      }
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "url"
                  ]
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Updates a post",
        "tags": [
          "Communication::Website::Post"
        ],
        "parameters": [
          {
            "name": "website_id",
            "in": "path",
            "description": "Website identifier",
            "example": "c8a4bed5-2e05-47e4-90e3-cf334c16453f",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Post identifier",
            "example": "84722b61-f7c3-43c5-9127-2292101af7c5",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": [
                      {
                        "id": "c8a4bed5-2e05-47e4-90e3-cf334c16453f",
                        "title": "Référentiel général d'écoconception de services numériques (RGESN)",
                        "published": true,
                        "published_at": "TODO"
                      }
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "url"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/communication/websites": {
      "get": {
        "summary": "Lists the websites",
        "tags": [
          "Communication::Website"
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "6d8fb0bb-0445-46f0-8954-0e25143e7a58",
                      "title": "Website identifier"
                    },
                    "name": {
                      "type": "string",
                      "example": "Site de démo",
                      "title": "Nom du site"
                    },
                    "url": {
                      "type": "string",
                      "example": "https://example.osuny.org",
                      "title": "URL du site"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/communication/websites/{id}": {
      "get": {
        "summary": "Shows a website",
        "tags": [
          "Communication::Website"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier",
            "example": "6d8fb0bb-0445-46f0-8954-0e25143e7a58",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation"
          }
        }
      }
    }
  }
}