<commit_before>openapi: 3.0.1
info: This api provides access to articles
servers:
- url: https://{environment}.example.com:{port}/{basePath}
  description: Production server
  variables:
    environment:
      default: api
      description: An api for devices at Google dot com
    port:
      enum:
        - 80
        - 443
      defualt: 80
    basePath:
      default: app
# to declare globally which files to include with other components declarations
uses:
  topics: oas/topic.yaml
components:
  schemas:
    ID:
      type: integer
      required: true
      maximum: 20
    SID:
      type: string
      required: true
      maxLength: 128
    Type:
      type: string
      required: true
      minLength: 1
      maxLength: 255
    DataObject:
      type: object
      required: true
    DataArray:
      type: array
      required: true
    RelationshipsDataItem:
      type: object
      properties:
        id: ID
        type: Type
    RelationshipsDataItemSID:
      type: object
      properties:
        id: SID
        type: Type
    Redis:
      type: object
    TagRelationships:
      description: Tag relationship description
      type: object
      properties:
        data:
          type: DataArray
          items:
            type: RelationshipsDataItem
    TagAttributes:
      description: Always set attributes for object
      type: object
      properties:
        title:
          type: string
          required: true
          minLength: 3
    Tag:
      type: object
      properties:
        type: Type
        id: ID
        attributes: TagAttributes
        relationships:
          type: ArticleRelationships[]
        cache:
          type: Redis
          properties:
            stampede_xfetch:
              type: boolean
              default: true
            stampede_beta:
              type: number
              default: 1.1
            ttl:
              type: integer
              default: 3600
    ArticleRelationships:
      type: object
      properties:
        data:
          type: DataArray
          items:
            type: RelationshipsDataItem
    ArticleAttributes:
      description: Article attributes description
      type: object
      properties:
        title:
          required: true
          type: string
          minLength: 16
          maxLength: 256
          facets:
            index:
              idx_title: index
        description:
          required: true
          type: string
          minLength: 32
          maxLength: 1024
          facets:
            spell_check: true
            spell_language: en
        url:
          required: false
          type: string
          minLength: 16
          maxLength: 255
          facets:
            index:
              idx_url: unique
        show_in_top:
          description: Show at the top of main page
          required: false
          type: boolean
        status:
          description: The state of an article
          enum: ["draft", "published", "postponed", "archived"]
          facets:
            state_machine:
              initial: ['draft']
              draft: ['published']
              published: ['archived', 'postponed']
              postponed: ['published', 'archived']
              archived: []
        topic_id:
          description: ManyToOne Topic relationship
          required: true
          type: integer
          minimum: 1
          maximum: 6
          facets:
            index:
              idx_fk_topic_id: foreign
              references: id
              on: topic
              onDelete: cascade
              onUpdate: cascade
        rate:
          type: number
          minimum: 3
          maximum: 9
          format: double
        date_posted:
          type: date-only
        time_to_live:
          type: time-only
        deleted_at:
          type: datetime
    Article:
      type: object
      properties:
        type: Type
        id: SID
        attributes: ArticleAttributes
        relationships:
          type: TagRelationships[] | TopicRelationships
        cache:
          type: Redis
          properties:
            stampede_xfetch:
              type: boolean
              default: true
            stampede_beta:
              type: number
              default: 1.5
            ttl:
              type: integer
              default: 300
    TopicRelationships:
      type: object
      properties:
        data:
          type: DataArray
          items:
            type: RelationshipsDataItem
    QueryParams:
      type: object
      properties:
        page:
          type: integer
          required: false
          description: page number
        limit:
          type: integer
          required: false
          default: 15
          example: 15
          description: elements per page
        sort:
          type: string
          required: false
          pattern: "asc|desc"
          default: "desc"
        access_token:
          type: string
          required: true
          example: <PASSWORD>9d5a3f381875ea6ce7e28fe1ea536d0acaf
          description: sha1 example
          default: db7329d5a3f381875ea6ce7e28fe1ea536d0acaf
    UserAttributes:
      type: object
      properties:
        first_name:
          required: true
          type: string
          minLength: 16
          maxLength: 256
        last_name:
          required: false
          type: string
          minLength: 16
          maxLength: 256
          facets:
            composite_index:
              index: ['first_name', 'last_name'] # can be unique, primary
        password:
          description: user password to refresh JWT (encrypted with password_hash)
          required: true
          type: string
          maxLength: 255
        jwt:
          description: Special field to run JWT Auth via requests
          required: true
          type: string
          maxLength: 512
          default: ' '
        permissions:
          type: integer
          required: false
          maximum: 20
          facets:
            bit_mask:
              publisher: 1
              editor: 2
              manager: 4
              photo_reporter: 8
              admin: 16
    User:
      type: object
      properties:
        type: Type
        id: ID
        attributes: UserAttributes
    Trees:
      type: object
      properties:
        menu:
          type: boolean
          default: true
    MenuAttributes:
      type: object
      properties:
        title:
          required: true
          type: string
        rfc:
          type: string
          default: /
        parent_id:
          description: mandatory field for building trees
          type: integer
          maximum: 10
          default: 0
    Menu:
      type: object
      properties:
        type: Type
        id: ID
        attributes: MenuAttributes
/article:
  get:
    queryParameters: QueryParams
    responses:
      200:
        body:
          application/json.vnd+json:
            type: Article[]
  post:
    body:
      application/json.vnd+json:
        type: Article
    responses:
      200:
        body:
          application/json.vnd+json:
            type: Article
  /{id}:
    get:
      responses:
        200:
          body:
            application/json.vnd+json:
              type: Article
    patch:
      body:
        application/json.vnd+json:
          type: Article
      responses:
        200:
          body:
            application/json.vnd+json:
              type: Article
    delete:
      responses:
        204:
    /relationships/tag:
      get:
        responses:
          200:
            body:
              application/json.vnd+json:
                type: TagRelationships
      post:
        body:
          application/json.vnd+json:
            type: TagRelationships
        responses:
          201:
            body:
              application/json.vnd+json:
                type: TagRelationships
      patch:
        body:
          application/json.vnd+json:
            type: TagRelationships
        responses:
          200:
            body:
              application/json.vnd+json:
                type: TagRelationships
      delete:
        responses:
          204:
    /tag:
      get:
        responses:
          200:
            body:
              application/json.vnd+json:
                type: Tag[]<commit_msg>#144. App generated files<commit_after>openapi: 3.0.1
info: This api provides access to articles
servers:
- url: https://{environment}.example.com:{port}/{basePath}
  description: Production server
  variables:
    environment:
      default: api
      description: An api for devices at Google dot com
    port:
      enum:
        - 80
        - 443
      defualt: 80
    basePath:
      default: v1
# to declare globally which files to include with other components declarations
uses:
  topics: oas/topic.yaml
components:
  schemas:
    ID:
      type: integer
      required: true
      maximum: 20
    SID:
      type: string
      required: true
      maxLength: 128
    Type:
      type: string
      required: true
      minLength: 1
      maxLength: 255
    DataObject:
      type: object
      required: true
    DataArray:
      type: array
      required: true
    RelationshipsDataItem:
      type: object
      properties:
        id: ID
        type: Type
    RelationshipsDataItemSID:
      type: object
      properties:
        id: SID
        type: Type
    Redis:
      type: object
    TagRelationships:
      description: Tag relationship description
      type: object
      properties:
        data:
          type: DataArray
          items:
            type: RelationshipsDataItem
    TagAttributes:
      description: Always set attributes for object
      type: object
      properties:
        title:
          type: string
          required: true
          minLength: 3
    Tag:
      type: object
      properties:
        type: Type
        id: ID
        attributes: TagAttributes
        relationships:
          type: ArticleRelationships[]
        cache:
          type: Redis
          properties:
            stampede_xfetch:
              type: boolean
              default: true
            stampede_beta:
              type: number
              default: 1.1
            ttl:
              type: integer
              default: 3600
    ArticleRelationships:
      type: object
      properties:
        data:
          type: DataArray
          items:
            type: RelationshipsDataItem
    ArticleAttributes:
      description: Article attributes description
      type: object
      properties:
        title:
          required: true
          type: string
          minLength: 16
          maxLength: 256
          facets:
            index:
              idx_title: index
        description:
          required: true
          type: string
          minLength: 32
          maxLength: 1024
          facets:
            spell_check: true
            spell_language: en
        url:
          required: false
          type: string
          minLength: 16
          maxLength: 255
          facets:
            index:
              idx_url: unique
        show_in_top:
          description: Show at the top of main page
          required: false
          type: boolean
        status:
          description: The state of an article
          enum: ["draft", "published", "postponed", "archived"]
          facets:
            state_machine:
              initial: ['draft']
              draft: ['published']
              published: ['archived', 'postponed']
              postponed: ['published', 'archived']
              archived: []
        topic_id:
          description: ManyToOne Topic relationship
          required: true
          type: integer
          minimum: 1
          maximum: 6
          facets:
            index:
              idx_fk_topic_id: foreign
              references: id
              on: topic
              onDelete: cascade
              onUpdate: cascade
        rate:
          type: number
          minimum: 3
          maximum: 9
          format: double
        date_posted:
          type: date-only
        time_to_live:
          type: time-only
        deleted_at:
          type: datetime
    Article:
      type: object
      properties:
        type: Type
        id: SID
        attributes: ArticleAttributes
        relationships:
          type: TagRelationships[] | TopicRelationships
        cache:
          type: Redis
          properties:
            stampede_xfetch:
              type: boolean
              default: true
            stampede_beta:
              type: number
              default: 1.5
            ttl:
              type: integer
              default: 300
    TopicRelationships:
      type: object
      properties:
        data:
          type: DataArray
          items:
            type: RelationshipsDataItem
    QueryParams:
      type: object
      properties:
        page:
          type: integer
          required: false
          description: page number
        limit:
          type: integer
          required: false
          default: 15
          example: 15
          description: elements per page
        sort:
          type: string
          required: false
          pattern: "asc|desc"
          default: "desc"
        access_token:
          type: string
          required: true
          example: <PASSWORD>
          description: sha1 example
          default: db7329d5a3f381875ea6ce7e28fe1ea536d0acaf
    UserAttributes:
      type: object
      properties:
        first_name:
          required: true
          type: string
          minLength: 16
          maxLength: 256
        last_name:
          required: false
          type: string
          minLength: 16
          maxLength: 256
          facets:
            composite_index:
              index: ['first_name', 'last_name'] # can be unique, primary
        password:
          description: user password to refresh JWT (encrypted with password_hash)
          required: true
          type: string
          maxLength: 255
        jwt:
          description: Special field to run JWT Auth via requests
          required: true
          type: string
          maxLength: 512
          default: ' '
        permissions:
          type: integer
          required: false
          maximum: 20
          facets:
            bit_mask:
              publisher: 1
              editor: 2
              manager: 4
              photo_reporter: 8
              admin: 16
    User:
      type: object
      properties:
        type: Type
        id: ID
        attributes: UserAttributes
    Trees:
      type: object
      properties:
        menu:
          type: boolean
          default: true
    MenuAttributes:
      type: object
      properties:
        title:
          required: true
          type: string
        rfc:
          type: string
          default: /
        parent_id:
          description: mandatory field for building trees
          type: integer
          maximum: 10
          default: 0
    Menu:
      type: object
      properties:
        type: Type
        id: ID
        attributes: MenuAttributes
/article:
  get:
    queryParameters: QueryParams
    responses:
      200:
        body:
          application/json.vnd+json:
            type: Article[]
  post:
    body:
      application/json.vnd+json:
        type: Article
    responses:
      200:
        body:
          application/json.vnd+json:
            type: Article
  /{id}:
    get:
      responses:
        200:
          body:
            application/json.vnd+json:
              type: Article
    patch:
      body:
        application/json.vnd+json:
          type: Article
      responses:
        200:
          body:
            application/json.vnd+json:
              type: Article
    delete:
      responses:
        204:
    /relationships/tag:
      get:
        responses:
          200:
            body:
              application/json.vnd+json:
                type: TagRelationships
      post:
        body:
          application/json.vnd+json:
            type: TagRelationships
        responses:
          201:
            body:
              application/json.vnd+json:
                type: TagRelationships
      patch:
        body:
          application/json.vnd+json:
            type: TagRelationships
        responses:
          200:
            body:
              application/json.vnd+json:
                type: TagRelationships
      delete:
        responses:
          204:
    /tag:
      get:
        responses:
          200:
            body:
              application/json.vnd+json:
                type: Tag[]
{'fraction_non_alphanumeric': 0.05833233925802219, 'fraction_numerical': 0.01729691041393296, 'mean_word_length': 1.2612272420768713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6766809', 'n_tokens_mistral': 4408, 'n_tokens_neox': 4149, 'n_words': 1238}