diff --git a/rsdo5.json b/rsdo5.json index e90634c..357c99b 100644 --- a/rsdo5.json +++ b/rsdo5.json @@ -51,7 +51,7 @@ } } }, - "/oznaciBesedilo": { + "/oznaciBesediloAsync": { "post": { "tags": [ "marktext" diff --git a/swagger_server/controllers/marktext_controller.py b/swagger_server/controllers/marktext_controller.py index b95caac..04211f8 100644 --- a/swagger_server/controllers/marktext_controller.py +++ b/swagger_server/controllers/marktext_controller.py @@ -1,7 +1,7 @@ import connexion import six -from swagger_server.models.oznaci_besedilo_body import OznaciBesediloBody # noqa: E501 +from swagger_server.models.oznaci_besedilo_async_body import OznaciBesediloAsyncBody # noqa: E501 from swagger_server import util from swagger_server.classla import cl_utils from swagger_server.requets_db.models.vrsta import (Job, JobManager) @@ -18,7 +18,7 @@ def get_text(body): # noqa: E501 :rtype: str """ if connexion.request.is_json: - body = OznaciBesediloBody.from_dict(connexion.request.get_json()) # noqa: E501 + body = OznaciBesediloAsyncBody.from_dict(connexion.request.get_json()) # noqa: E501 # conllu = cl_utils.raw_text_to_conllu(body.besedilo) # return conllu job, is_old_job = JobManager.create_job(1, body.besedilo) diff --git a/swagger_server/models/__init__.py b/swagger_server/models/__init__.py index dade2a3..802bc90 100644 --- a/swagger_server/models/__init__.py +++ b/swagger_server/models/__init__.py @@ -4,7 +4,7 @@ from __future__ import absolute_import # import models into model package from swagger_server.models.izlusci_body import IzlusciBody -from swagger_server.models.oznaci_besedilo_body import OznaciBesediloBody +from swagger_server.models.oznaci_besedilo_async_body import OznaciBesediloAsyncBody from swagger_server.models.terminoloski_kandidat import TerminoloskiKandidat from swagger_server.models.job_response import JobResponse from swagger_server.models.datoteka_v_besedilo_body import DatotekaVBesediloBody diff --git a/swagger_server/models/oznaci_besedilo_body.py b/swagger_server/models/oznaci_besedilo_async_body.py similarity index 62% rename from swagger_server/models/oznaci_besedilo_body.py rename to swagger_server/models/oznaci_besedilo_async_body.py index 18de203..2e5fda0 100644 --- a/swagger_server/models/oznaci_besedilo_body.py +++ b/swagger_server/models/oznaci_besedilo_async_body.py @@ -9,15 +9,15 @@ from swagger_server.models.base_model_ import Model from swagger_server import util -class OznaciBesediloBody(Model): +class OznaciBesediloAsyncBody(Model): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self, besedilo: str=None): # noqa: E501 - """OznaciBesediloBody - a model defined in Swagger + """OznaciBesediloAsyncBody - a model defined in Swagger - :param besedilo: The besedilo of this OznaciBesediloBody. # noqa: E501 + :param besedilo: The besedilo of this OznaciBesediloAsyncBody. # noqa: E501 :type besedilo: str """ self.swagger_types = { @@ -30,32 +30,32 @@ class OznaciBesediloBody(Model): self._besedilo = besedilo @classmethod - def from_dict(cls, dikt) -> 'OznaciBesediloBody': + def from_dict(cls, dikt) -> 'OznaciBesediloAsyncBody': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The oznaciBesedilo_body of this OznaciBesediloBody. # noqa: E501 - :rtype: OznaciBesediloBody + :return: The oznaciBesediloAsync_body of this OznaciBesediloAsyncBody. # noqa: E501 + :rtype: OznaciBesediloAsyncBody """ return util.deserialize_model(dikt, cls) @property def besedilo(self) -> str: - """Gets the besedilo of this OznaciBesediloBody. + """Gets the besedilo of this OznaciBesediloAsyncBody. - :return: The besedilo of this OznaciBesediloBody. + :return: The besedilo of this OznaciBesediloAsyncBody. :rtype: str """ return self._besedilo @besedilo.setter def besedilo(self, besedilo: str): - """Sets the besedilo of this OznaciBesediloBody. + """Sets the besedilo of this OznaciBesediloAsyncBody. - :param besedilo: The besedilo of this OznaciBesediloBody. + :param besedilo: The besedilo of this OznaciBesediloAsyncBody. :type besedilo: str """ diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 0220cf3..93d3c62 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -38,7 +38,7 @@ paths: schema: $ref: '#/components/schemas/JobResponse' x-openapi-router-controller: swagger_server.controllers.jobs_controller - /oznaciBesedilo: + /oznaciBesediloAsync: post: tags: - marktext @@ -49,7 +49,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/oznaciBesedilo_body' + $ref: '#/components/schemas/oznaciBesediloAsync_body' required: true responses: "200": @@ -578,7 +578,7 @@ components: estimated_completion: 2000-01-23T04:56:07.000+00:00 job_result: job_result finished_job: true - oznaciBesedilo_body: + oznaciBesediloAsync_body: type: object properties: besedilo: diff --git a/swagger_server/test/test_marktext_controller.py b/swagger_server/test/test_marktext_controller.py index dca58b2..4f051c5 100644 --- a/swagger_server/test/test_marktext_controller.py +++ b/swagger_server/test/test_marktext_controller.py @@ -5,7 +5,7 @@ from __future__ import absolute_import from flask import json from six import BytesIO -from swagger_server.models.oznaci_besedilo_body import OznaciBesediloBody # noqa: E501 +from swagger_server.models.oznaci_besedilo_async_body import OznaciBesediloAsyncBody # noqa: E501 from swagger_server.test import BaseTestCase @@ -17,9 +17,9 @@ class TestMarktextController(BaseTestCase): Označi besedilo s classlo/stanzo z uporabo slovenskih modelov ter vrne conll-u format """ - body = OznaciBesediloBody() + body = OznaciBesediloAsyncBody() response = self.client.open( - '/oznaciBesedilo', + '/oznaciBesediloAsync', method='POST', data=json.dumps(body), content_type='application/json')