<commit_before>security:
  - jwtBearer: []
info:
  title: Schul-Cloud WOPI Service API
  description:
    This is the API specification for the Schul-Cloud WOPI service.
    
  contact:
    name: support
    email: <EMAIL>
  license:
    name: GPL-3.0
    url: 'https://github.com/hpi-schul-cloud/schulcloud-server/blob/master/LICENSE'
  version: 1.0.0
components:
  securitySchemes:
    jwtBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    files:
      description: TODO
    files_list:
      description: TODO

paths:
  '/wopi/files/{fileId}/contents':
    get:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files_list'
        '401':
          description: not authenticated
        '500':
          description: general error
      description: retrieves a file`s binary contents.
      summary: ''
      tags:
        - wopi
      security: []
    post:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
        - in: header
          name: x-wopi-override
          schema:
            type: string
            enum: [DELETE, LOCK, GET_LOCK, UNLOCK, REFRESH_LOCK, RENAME_FILE, GET_SHARE_URL, PUT_USER_INFO]
          required: true
          description: the wopi operation to perform
        - in: header
          name: x-wopi-requestedname
          schema:
            type: string
          required: true
          description: A UTF-7 encoded string that is a file name, not including the file extension.
        - in: header
          name: x-wopi-lock
          schema:
            type: string
          required: true
          description: A string to identify the lock to a file. required for 'LOCK', 'PUT', 'REFRESH_LOCK', 'UNLOCK'.
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files'
        '401':
          description: not authenticated
        '500':
          description: general error
      description: updates a file’s binary contents, file has to exist in schulcloud db.
      summary: ''
      tags:
        - wopi
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/files'
  '/wopi/files/{fileId}':
    get:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files_list'
        '401':
          description: not authenticated
        '500':
          description: general error
      description: returns information about a file, a user’s permissions on that file, and general information about the capabilities that the WOPI host has on the file.
      summary: ''
      tags:
        - wopi
      security: []
    post:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
        - in: header
          name: x-wopi-override
          schema:
            type: string
            enum: [DELETE, LOCK, GET_LOCK, UNLOCK, REFRESH_LOCK, RENAME_FILE, GET_SHARE_URL, PUT_USER_INFO]
          required: true
          description: the wopi operation to perform
        - in: header
          name: x-wopi-requestedname
          schema:
            type: string
          required: true
          description: A UTF-7 encoded string that is a file name, not including the file extension.
        - in: header
          name: x-wopi-lock
          schema:
            type: string
          required: true
          description: A string to identify the lock to a file. required for 'LOCK', 'PUT', 'REFRESH_LOCK', 'UNLOCK'.
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files'
        '401':
          description: not authenticated
        '500':
          description: general error
      description: Performs a wopi request specified with the x-wopi-override and x-wopi-requestedname headers.
      summary: ''
      tags:
        - wopi
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/files'
  
openapi: 3.0.2
tags:
  - name: wopi
    description: A service for handling the wopi GetFile & PutFile operation.
      More information under https://wopirest.readthedocs.io/en/latest/<commit_msg>wopi responses<commit_after>security:
  - jwtBearer: []
info:
  title: Schul-Cloud WOPI Service API
  description:
    This is the API specification for the Schul-Cloud WOPI service.
    
  contact:
    name: support
    email: <EMAIL>
  license:
    name: GPL-3.0
    url: 'https://github.com/hpi-schul-cloud/schulcloud-server/blob/master/LICENSE'
  version: 1.0.0
components:
  securitySchemes:
    jwtBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    wopi_metadata:
      description: metadata according to wopi standard
      type: object
      properties:
        SupportsCobalt:
          type: boolean
        SupportsContainers:
          type: boolean
        SupportsDeleteFile:
          type: boolean
        SupportsEcosystem:
          type: boolean
        SupportsExtendedLockLength:
          type: boolean
        SupportsFolders:
          type: boolean
        SupportsGetFileWopiSrc:
          type: boolean
        SupportsGetLock:
          type: boolean
        SupportsLocks:
          type: boolean
        SupportsRename:
          type: boolean
        SupportsUpdate:
          type: boolean
        SupportsUserInfo:
          type: boolean
        UserCanRename:
          type: boolean
        OwnerId:
          type: string
          pattern: '^[0-9a-f]{24}$'
        UserId:
          type: string
          pattern: '^[0-9a-f]{24}$'
        BaseFileName:
          type: string
        Size:
          type: integer
        Version:
          type: integer
        UserFriendlyName:
          type: string
        UserCanWrite:
          type: boolean
        UserCanNotWriteRelative:
          type: boolean
        
    files:
      description: TODO
paths:
  '/wopi/files/{fileId}/contents':
    get:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: string
                format: binary
        '401':
          description: not authenticated
        '500':
          description: general error
      description: retrieves a file`s binary contents.
      summary: ''
      tags:
        - wopi
      security: []
    post:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
        - in: header
          name: x-wopi-override
          schema:
            type: string
            enum: [DELETE, LOCK, GET_LOCK, UNLOCK, REFRESH_LOCK, RENAME_FILE, GET_SHARE_URL, PUT_USER_INFO]
          required: true
          description: the wopi operation to perform
        - in: header
          name: x-wopi-requestedname
          schema:
            type: string
          required: true
          description: A UTF-7 encoded string that is a file name, not including the file extension.
        - in: header
          name: x-wopi-lock
          schema:
            type: string
            format: binary
          required: true
          description: A string to identify the lock to a file. required for 'LOCK', 'PUT', 'REFRESH_LOCK', 'UNLOCK'.
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                type: string
                format: binary
        '401':
          description: not authenticated
        '500':
          description: general error
      description: updates a file’s binary contents, file has to exist in schulcloud db.
      summary: ''
      tags:
        - wopi
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/files'
  '/wopi/files/{fileId}':
    get:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/wopi_metadata'
        '401':
          description: not authenticated
        '500':
          description: general error
      description: returns information about a file, a user’s permissions on that file, and general information about the capabilities that the WOPI host has on the file.
      summary: ''
      tags:
        - wopi
      security: []
    post:
      parameters:
        - in: path
          name: fileId
          schema:
            type: string
          required: true
          description: fileId parameter
        - in: header
          name: x-wopi-override
          schema:
            type: string
            enum: [DELETE, LOCK, GET_LOCK, UNLOCK, REFRESH_LOCK, RENAME_FILE, GET_SHARE_URL, PUT_USER_INFO]
          required: true
          description: the wopi operation to perform
        - in: header
          name: x-wopi-requestedname
          schema:
            type: string
          required: true
          description: A UTF-7 encoded string that is a file name, not including the file extension.
        - in: header
          name: x-wopi-lock
          schema:
            type: string
          required: true
          description: A string to identify the lock to a file. required for 'LOCK', 'PUT', 'REFRESH_LOCK', 'UNLOCK'.
      responses:
        '201':
          description: created
          content:
            application/json:
              schema:
                {}
        '401':
          description: not authenticated
        '500':
          description: general error
      description: Performs a wopi request specified with the x-wopi-override and x-wopi-requestedname headers.
      summary: ''
      tags:
        - wopi
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/files'
  
openapi: 3.0.2
tags:
  - name: wopi
    description: A service for handling the wopi GetFile & PutFile operation.
      More information under https://wopirest.readthedocs.io/en/latest/
{'fraction_non_alphanumeric': 0.07467335813792507, 'fraction_numerical': 0.00865276455827637, 'mean_word_length': 1.5302101576182137, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3813509', 'n_tokens_mistral': 3136, 'n_tokens_neox': 3034, 'n_words': 934}