paths:
  '':
    $name: dvhb_hybrid.users:create
    post:
      $handler: dvhb_hybrid.users.views.create_user
      tags:
        - user
      summary: Create new user
      description: Returns api_key on successful user creation
      consumes:
      - application/json
      - application/x-www-form-urlencoded
      produces:
      - application/json
      parameters:
      - name: user
        in: body
        required: true
        schema:
          $ref: '#/definitions/NewUser'

      responses:
        200:
          description: OK
        400:
          description: Invalid parameters given
        406:
          description: Wrong recapture
        409:
          description: User already exists


definitions:
  NewUser:
    type: object
    additionalProperties: false
    properties:
      email:
        type: string
        format: email
        minLength: 5
      password:
        type: string
        format: password
        pattern: '^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$'
      lang_code:
        type: string
        pattern: '^[a-z]{2}$'
        description: ISO 639-1 alpha-2 language code for language to be used for activation email sending
        default: en
      g-recaptcha-response:
        type: string
    required:
      - email
      - password
      - g-recaptcha-response
    example:
      email: new_user@example.com
      password: Pa55w0rd
      lang_code: fr
      g-recaptcha-response: xxx

paths:
  '':
    $name: dvhb_hybrid.users:create
    post:
      $handler: dvhb_hybrid.users.views.create_user
      tags:
        - user
      summary: Create new user
      description: Returns api_key on successful user creation
      consumes:
      - application/json
      - application/x-www-form-urlencoded
      produces:
      - application/json
      parameters:
      - name: user
        in: body
        required: true
        schema:
          $ref: '#/definitions/NewUser'

      responses:
        200:
          description: OK
        400:
          description: Invalid parameters given
        406:
          description: Wrong recapture
        409:
          description: User already exists


definitions:
  NewUser:
    type: object
    additionalProperties: false
    properties:
      email:
        type: string
        format: email
        minLength: 5
      password:
        type: string
        format: password
        minLength: 5
      lang_code:
        type: string
        pattern: '^[a-z]{2}$'
        description: ISO 639-1 alpha-2 language code for language to be used for activation email sending
        default: en
      g-recaptcha-response:
        type: string
    required:
      - email
      - password
      - g-recaptcha-response
    example:
      email: new_user@example.com
      password: Pa55w0rd
      lang_code: fr
      g-recaptcha-response: xxx

Remove regular expression for password in user creation API spec
Remove regular expression for password in user creation API spec
