openapi: 3.0.3
info:
    title: 'The Censorship API'
    description: 'The Censorship API gives you the power to censor anybody, anywhere. Keep them from using dirty words, like "family", and "love". Ugh🤮.'
    version: 1.0.0
servers:
    -
        url: 'http://localhost:8000'
paths:
    /api/badwords:
        get:
            summary: 'Fetch the list of bad words.'
            description: ''
            parameters:
                -
                    in: query
                    name: 'filters[how_bad_is_it]'
                    description: 'Filter by level of badness.'
                    example: eaque
                    required: false
                    schema:
                        type: string
                        description: 'Filter by level of badness.'
                        example: eaque
                -
                    in: query
                    name: 'filters[created_at]'
                    description: 'Filter for when the word was created.'
                    example: blanditiis
                    required: false
                    schema:
                        type: string
                        description: 'Filter for when the word was created.'
                        example: blanditiis
                -
                    in: query
                    name: 'fields[]'
                    description: 'Fields to include in the response'
                    example: corporis
                    required: false
                    schema:
                        type: string
                        description: 'Fields to include in the response'
                        example: corporis
                -
                    in: query
                    name: page
                    description: 'Page number to return.'
                    example: 1
                    required: false
                    schema:
                        type: string
                        description: 'Page number to return.'
                        example: 1
                -
                    in: query
                    name: pageSize
                    description: 'Number of items to return in a page. Defaults to 10.'
                    example: null
                    required: false
                    schema:
                        type: string
                        description: 'Number of items to return in a page. Defaults to 10.'
                        example: null
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    current_page: 1
                                    data: [{ id: 1, word: est, how_bad_is_it: 'very bad', created_at: '2020-09-10T17:19:10.000000Z', updated_at: '2020-09-10T17:19:10.000000Z' }, { id: 2, word: molestiae, how_bad_is_it: 'very bad', created_at: '2020-09-10T17:19:10.000000Z', updated_at: '2020-09-10T17:19:10.000000Z' }]
                                    first_page_url: 'http://localhost/api/badwords?page=1'
                                    from: 1
                                    last_page: 6
                                    last_page_url: 'http://localhost/api/badwords?page=6'
                                    links: [{ url: null, label: Previous, active: false }, { url: 'http://localhost/api/badwords?page=1', label: 1, active: true }, { url: 'http://localhost/api/badwords?page=2', label: 2, active: false }, { url: 'http://localhost/api/badwords?page=3', label: 3, active: false }, { url: 'http://localhost/api/badwords?page=4', label: 4, active: false }, { url: 'http://localhost/api/badwords?page=5', label: 5, active: false }, { url: 'http://localhost/api/badwords?page=6', label: 6, active: false }, { url: 'http://localhost/api/badwords?page=2', label: Next, active: false }]
                                    next_page_url: 'http://localhost/api/badwords?page=2'
                                    path: 'http://localhost/api/badwords'
                                    per_page: 2
                                    prev_page_url: null
                                    to: 2
                                    total: 12
                                properties:
                                    current_page: { type: integer, example: 1 }
                                    data: { type: array, example: [{ id: 1, word: est, how_bad_is_it: 'very bad', created_at: '2020-09-10T17:19:10.000000Z', updated_at: '2020-09-10T17:19:10.000000Z' }, { id: 2, word: molestiae, how_bad_is_it: 'very bad', created_at: '2020-09-10T17:19:10.000000Z', updated_at: '2020-09-10T17:19:10.000000Z' }], items: { type: object } }
                                    first_page_url: { type: string, example: 'http://localhost/api/badwords?page=1' }
                                    from: { type: integer, example: 1 }
                                    last_page: { type: integer, example: 6 }
                                    last_page_url: { type: string, example: 'http://localhost/api/badwords?page=6' }
                                    links: { type: array, example: [{ url: null, label: Previous, active: false }, { url: 'http://localhost/api/badwords?page=1', label: 1, active: true }, { url: 'http://localhost/api/badwords?page=2', label: 2, active: false }, { url: 'http://localhost/api/badwords?page=3', label: 3, active: false }, { url: 'http://localhost/api/badwords?page=4', label: 4, active: false }, { url: 'http://localhost/api/badwords?page=5', label: 5, active: false }, { url: 'http://localhost/api/badwords?page=6', label: 6, active: false }, { url: 'http://localhost/api/badwords?page=2', label: Next, active: false }], items: { type: object } }
                                    next_page_url: { type: string, example: 'http://localhost/api/badwords?page=2' }
                                    path: { type: string, example: 'http://localhost/api/badwords' }
                                    per_page: { type: integer, example: 2 }
                                    prev_page_url: { type: string, example: null }
                                    to: { type: integer, example: 2 }
                                    total: { type: integer, example: 12 }
            tags:
                - 'Bad words'
            security: []
        post:
            summary: 'Add a word to the list.'
            description: "This endpoint allows you to add a word to the list. It's a really useful endpoint,\nand you should play around with it for a bit.\n<aside class=\"warning\">We mean it; you really should.😕</aside>"
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                201:
                    description: '201, Word added'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    id: 'http://google.com?page=3'
                                properties:
                                    id: { type: string, example: 'http://google.com?page=3' }
            tags:
                - 'Bad words'
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                word:
                                    type: string
                                    description: 'The word.'
                                    example: '"children"'
                                how_bad_is_it:
                                    type: string
                                    description: 'One of: `unspeakable`, `horrible`, `very bad`, `bad`.'
                                    example: 'very bad'
                                dad:
                                    type: boolean
                                    description: ''
                                    example: false
                            required:
                                - word
            security: []
    '/api/badwords/{badword}':
        get:
            summary: 'Fetch a specific bad word.'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    id: 1
                                    word: est
                                    how_bad_is_it: 'very bad'
                                    created_at: '2020-09-10T17:19:10.000000Z'
                                    updated_at: '2020-09-10T17:19:10.000000Z'
                                properties:
                                    id: { type: integer, example: 1 }
                                    word: { type: string, example: est }
                                    how_bad_is_it: { type: string, example: 'very bad' }
                                    created_at: { type: string, example: '2020-09-10T17:19:10.000000Z' }
                                    updated_at: { type: string, example: '2020-09-10T17:19:10.000000Z' }
            tags:
                - 'Bad words'
            security: []
        put:
            summary: 'Update a bad word.'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - 'Bad words'
            requestBody:
                required: false
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                how_bad_is_it:
                                    type: string
                                    description: 'One of: `unspeakable`, `horrible`, `very bad`, `bad`.'
                                    example: 'very bad'
        delete:
            summary: 'Remove a bad word from the list.'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                204:
                    description: '204'
            tags:
                - 'Bad words'
            security: []
        parameters:
            -
                in: path
                name: badword
                description: 'The ID of the word.'
                example: '1'
                required: true
                schema:
                    type: string
    /api/healthcheck:
        get:
            summary: 'Health check'
            description: "Check if the API is still alive.\n\nPS. This is a Closure route. 😄"
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: ''
                    content:
                        text/plain:
                            schema:
                                type: string
                                example: 'Hi!! 👋'
            tags:
                - Endpoints
            security: []
    /api/user:
        get:
            summary: ''
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
            security: []
    /api/services/highlightBadWordsInText:
        post:
            summary: 'Highlight bad words in texts.'
            description: 'This endpoint will highlight any bad words in the provided texts, surrounding them with `<em></em>` HTML tags.'
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/x-www-form-urlencoded
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    highlighted: 'He <em>loves</em> his <em>family</em> sooo much!'
                                properties:
                                    highlighted: { type: string, example: 'He <em>loves</em> his <em>family</em> sooo much!' }
            tags:
                - Services
            requestBody:
                required: false
                content:
                    application/x-www-form-urlencoded:
                        schema:
                            type: object
                            properties:
                                texts:
                                    type: array
                                    description: 'Texts to be highlighted.'
                                    example: ['He loves his family sooo much', 'But they don''t fucking love him back.']
                                    items: { type: string }
                                things:
                                    type: array
                                    description: 'Things to be done.'
                                    example: [[], []]
                                    items: { type: object, properties: { name: { type: string, description: Thing., example: sapiente } }, required: [name] }
            security: []
    '/api/services/censorTexts/{mode}':
        post:
            summary: 'Censor bad words in texts.'
            description: 'This endpoint will censor any bad words in a list of texts.'
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: '200'
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    type: string
                                example:
                                    - 'He l===s his f====y sooo much'
                                    - 'But they don''t fucking l===e him back.'
            tags:
                - Services
            requestBody:
                required: false
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                texts:
                                    type: array
                                    description: 'Text to be censored.'
                                    example: 'He loves his family sooo much'
                                    items: { type: string }
                                items:
                                    type: object
                                    description: 'An it'
                                    example: []
                                    properties: { inttt: { type: integer, description: 'Other it', example: 4 } }
                                things:
                                    type: array
                                    description: 'Things to be done.'
                                    example: [[], []]
                                    items: { type: object, properties: { name: { type: string, description: Thing., example: nam } }, required: [name] }
            security: []
        parameters:
            -
                in: path
                name: mode
                description: "Optional parameter. Censorship mode. `full` will replace the entire word with `=====`,\n`partial` will replace all characters but the first and last. Defaults to `partial`."
                required: true
                schema:
                    type: string
                examples:
                    omitted:
                        summary: 'When the value is omitted'
                        value: ''
                    present:
                        summary: 'When the value is present'
                        value: ea
    /api/services/censorImage:
        post:
            summary: 'Censor bad words in an image.'
            description: 'This endpoint will censor any bad words in the provided image and return the censored image. All bad words will be replaced by ======.'
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: multipart/form-data
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: 'The censored image'
                    content:
                        application/octet-stream:
                            schema:
                                type: string
                                format: binary
                400:
                    description: '400, When the image''s words are too powerful😢'
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: 'Operation failed'
                                    reason: 'The words are too touching.😭'
                                properties:
                                    message: { type: string, example: 'Operation failed' }
                                    reason: { type: string, example: 'The words are too touching.😭' }
            tags:
                - Services
            requestBody:
                required: true
                content:
                    multipart/form-data:
                        schema:
                            type: object
                            properties:
                                image:
                                    type: string
                                    format: binary
                                    description: 'The image containing text to be censored.'
                            required:
                                - image
            security: []
    /api/services/getTopBadWords:
        get:
            summary: 'Get the most frequently used bad words.'
            description: 'PS: This response was generated using the `@apiResource` and `@apiResourceModel` tag. 😏'
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    data: [{ word: sed, how_bad_is_it: 'very bad' }, { word: consequatur, how_bad_is_it: horrible }]
                                    links: { first: '/?page=1', last: null, prev: null, next: null }
                                    meta: { current_page: 1, from: 1, path: /, per_page: '5', to: 2 }
                                properties:
                                    data: { type: array, example: [{ word: sed, how_bad_is_it: 'very bad' }, { word: consequatur, how_bad_is_it: horrible }], items: { type: object } }
                                    links: { type: object, example: { first: '/?page=1', last: null, prev: null, next: null } }
                                    meta: { type: object, example: { current_page: 1, from: 1, path: /, per_page: '5', to: 2 } }
            tags:
                - Services
            security: []
    /api/services/getBadWordStats:
        get:
            summary: 'Get stats for a word''s usage.'
            description: 'PS: This response was generated using the `@transformer` tag. 😏'
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    data: { word: earum, last_used: 1602167486, frequency: 1240354959 }
                                properties:
                                    data: { type: object, example: { word: earum, last_used: 1602167486, frequency: 1240354959 } }
            tags:
                - Services
            security: []
components:
    securitySchemes:
        default:
            type: http
            scheme: bearer
            description: ''
security:
    -
        default: []
