@expose("<STR_LIT:/>", methods=["<STR_LIT:POST>"])<EOL><INDENT>@protect()<EOL>@safe<EOL>@permission_name("<STR_LIT>")<EOL>def post(self):<DEDENT>
if not request.is_json:<EOL><INDENT>return self.response_400(message="<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>item = self.add_model_schema.load(request.json)<EOL><DEDENT>except ValidationError as err:<EOL><INDENT>return self.response_422(message=err.messages)<EOL><DEDENT>if isinstance(item.data, dict):<EOL><INDENT>return self.response_422(message=item.errors)<EOL><DEDENT>self.pre_add(item.data)<EOL>try:<EOL><INDENT>self.datamodel.add(item.data, raise_exception=True)<EOL>self.post_add(item.data)<EOL>return self.response(<EOL><NUM_LIT>,<EOL>**{<EOL>API_RESULT_RES_KEY: self.add_model_schema.dump(<EOL>item.data, many=False<EOL>).data,<EOL>"<STR_LIT:id>": self.datamodel.get_pk_value(item.data),<EOL>}<EOL>)<EOL><DEDENT>except IntegrityError as e:<EOL><INDENT>return self.response_422(message=str(e.orig))<EOL><DEDENT>
POST item to Model
        ---
        post:
          requestBody:
            description: Model schema
            required: true
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/{{self.__class__.__name__}}.post'
          responses:
            201:
              description: Item inserted
              content:
                application/json:
                  schema:
                    type: object
                    properties:
                      id:
                        type: string
                      result:
                        $ref: '#/components/schemas/{{self.__class__.__name__}}.post'
            400:
              $ref: '#/components/responses/400'
            401:
              $ref: '#/components/responses/401'
            422:
              $ref: '#/components/responses/422'
            500:
              $ref: '#/components/responses/500'