apigitlabs / apigit-support

APIGIT is a native Git based collaboration platform for API design, document, mock and share.
https://apigit.com
1 stars 0 forks source link

Allow editing example in schema form #18

Closed nad-au closed 1 year ago

nad-au commented 1 year ago

Is there an existing request for this feature?

Is your feature request related to a problem?

When defining schema you can create a property-level example:

{
  "properties": {
    "clientReference": {
      "type": "string",
      "description": "Client-provided identifier",
      "example": "ef9bd8e5-5781-4ed9-80ef-39a0b5bd41ce"
    },
    "name": {
      "type": "string",
      "description": "A descriptive name for display purposes",
      "example": "Smith, 52 George St"
    }
}

But seems there's no way to edit the example without going into code view.

Also there's a schema example button which renders a json object from the schema. But each field does not use the example value and so you end up with:

{
  "clientReference": "string",
  "name": "string"
}

instead of

{
  "clientReference": "ef9bd8e5-5781-4ed9-80ef-39a0b5bd41ce",
  "name": "Smith, 52 George St"
}

Describe the solution you'd like

  1. Allow editing the example value in the same row as the description

image

or in the advanced setting dialog

image

  1. Take the example value if given, or fall back to default value if given, when creating a readonly example

image

Describe alternatives you've considered

No response

Additional context

No response

apigitlabs commented 1 year ago

thank you, @neildobson-au , they are very nice suggestions. regarding #1, which is already supported in the advanced setting dialog. It is already showed up in your screenshots. regarding #2, our R&D team has just deployed a version to improve it today, please check if it works for you now.

nad-au commented 1 year ago

Thank you for the prompt response. As per point 2, example is now working image

And for point 1, I didn't spot this before. You can indeed edit the json schema directly in the advanced dialog. I wonder if a few users might mistake this for a read-only view.

Anyway, thanks this solves my issues. Great product btw :+1: . I did spot some typos so I'll raise separate tickets.

Thanks.

apigitlabs commented 1 year ago

thanks @neildobson-au, we will close this ticket first. feel free to open new tickets if you find anything else in future.