Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create an entity through Swagger if one contains the number field where the str is expected #633

Open
BPylypenko opened this issue Oct 28, 2021 · 0 comments
Labels
feature [Added] for new features. minor not directly related to functionality and data. No workarounds are needed to complete the action swagger WG:API Working Group: All about odahu api functionality

Comments

@BPylypenko
Copy link
Contributor

Description
When the user tries to create an entity through Swagger API from a JSON file that contains number fields, it returns the error:

{
"message": "json: cannot unmarshal number into Go struct field ResourceList.spec.resources.limits.cpu of type string"
}.

Steps to Reproduce

  1. Go to API Gateway page of ODAHU Web UI.
  2. Try to create model training where spec.model.version or ....cpu contains integers.
  3. Notice that Swagger perceive this as valid JSON (allows execution), but the error is returned:

    {
    "message": "json: cannot unmarshal number into Go struct field ResourceList.spec.resources.limits.cpu of type string"
    }.

Actual result
When the user tries to create an entity from a JSON file with number fields through Swagger API, it returns the error:

{
"message": "json: cannot unmarshal number into Go struct field ResourceList.spec.resources.limits.cpu of type string"
}.

Expected result
The user can create an entity from a JSON file which contains number fields through Swagger API.

Attachments
image

Environment:

  • OS: Win10, MacOS v11.6
  • Browser: chrome, firefox
  • ODAHU version: 1.6.0
@BPylypenko BPylypenko added bug Something isn't working WG:API Working Group: All about odahu api functionality swagger labels Oct 28, 2021
@BPylypenko BPylypenko changed the title Cannot create an entity through Swagger if one contains the number field Cannot create an entity through Swagger if one contains the number field where the str is expected Oct 28, 2021
@viravit viravit added minor not directly related to functionality and data. No workarounds are needed to complete the action feature [Added] for new features. and removed bug Something isn't working labels Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [Added] for new features. minor not directly related to functionality and data. No workarounds are needed to complete the action swagger WG:API Working Group: All about odahu api functionality
Projects
None yet
Development

No branches or pull requests

2 participants