docs icon indicating copy to clipboard operation
docs copied to clipboard

PramField: document types

Open aviau opened this issue 1 year ago • 5 comments

These are the types that I could guess. There is probably more. It took me a while to figure out the array syntax.

aviau avatar Aug 12 '24 17:08 aviau

Preview:

Screenshot 2024-08-12 at 1 35 18 PM

aviau avatar Aug 12 '24 17:08 aviau

@aviau The type prop is used to pass any string, not specific data types. The type prop supports and accepts string only. Within that string, you can write any data type or even any piece of text you want to type (even if it doesn't make sense to do so). There is no constraint enforced by Mintlify here.

mohab-sameh avatar Aug 16 '24 11:08 mohab-sameh

There is no constraint enforced by Mintlify here.

@mohab-sameh that is not really true if you consider the playground.

I had to try many things until I figured out that string[] worked for the playground.

aviau avatar Aug 16 '24 13:08 aviau

@aviau ah yes, I didn't consider that! Hmm maybe this needs some brainstorming by the Mintlify team. Simply putting a constraint over the type prop will cause issues in non-playground cases where you might have several allowed data types like string | object | etc... Maybe for now having a callout that explains these constraints that only apply in playground configuration can be a middle ground.

mohab-sameh avatar Aug 16 '24 13:08 mohab-sameh

Yeah I don't suggest putting a constraint, I only suggest documenting which types work with the playground. Feel free to edit my PR to whatever you think is acceptable, as long as it ends up documentng the suppoted playground types.

aviau avatar Aug 16 '24 13:08 aviau