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

REST service with optional parameter -> misp2 doesn't generate an additional empty option tag for select-box #8

Open
aasaru opened this issue Nov 9, 2022 · 1 comment

Comments

@aasaru
Copy link

aasaru commented Nov 9, 2022

I have a REST search service with optional header parameter of type enum:

        - in: header
          name: personType
          description: Filter by person type
          required: false
          schema:
            type: string
            enum: [INDIVIDUAL, LEGAL_ENTITY]

MISP2 generates the following SELECTbox out of this:

 <div class="field">
   <label>Filter by person type</label>
   <select name="personType" data-rf-param-location="header">
      <option value="INDIVIDUAL">INDIVIDUAL</option>
      <option value="LEGAL_ENTITY">LEGAL_ENTITY</option>
   </select>
 </div>

But Misp2 doesn't add empty option to the front (for the case if I don't want to specify anything).

The required behaviour would be that since the element is declared as required=false there should be an additional option tag in the front:

<div class="field">
    <label>Filter by person type</label>
    <select name="personType" data-rf-param-location="header">
      <option value="">--</option>
      <option value="INDIVIDUAL">INDIVIDUAL</option>
      <option value="LEGAL_ENTITY">LEGAL_ENTITY</option>
   </select>
 </div>
@raits
Copy link
Contributor

raits commented Nov 16, 2022

Thank you for reporting this problem to us.

I have created a backlog item in our JIRA to tackle this: https://nordic-institute.atlassian.net/browse/MISPDEV-85

Unfortunately, I can not offer a timeline for when we can introduce this improvement to MISP2 at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants