code-snippet.json 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. "$schema": "https://raw.githubusercontent.com/elyra-ai/elyra/main/elyra/metadata/schemas/meta-schema.json",
  3. "$id": "https://raw.githubusercontent.com/elyra-ai/elyra/main/elyra/metadata/schemas/code-snippet.json",
  4. "title": "Code Snippet",
  5. "name": "code-snippet",
  6. "schemaspace": "code-snippets",
  7. "schemaspace_id": "aa60988f-8f7c-4d09-a243-c54ef9c2f7fb",
  8. "uihints": {
  9. "title": "Code Snippets",
  10. "icon": "elyra:code-snippet",
  11. "reference_url": "https://elyra.readthedocs.io/en/latest/user_guide/code-snippets.html"
  12. },
  13. "properties": {
  14. "schema_name": {
  15. "title": "Schema Name",
  16. "description": "The schema associated with this instance",
  17. "type": "string",
  18. "const": "code-snippet"
  19. },
  20. "display_name": {
  21. "title": "Display Name",
  22. "description": "The display name of the Code Snippet",
  23. "type": "string",
  24. "minLength": 1
  25. },
  26. "metadata": {
  27. "description": "Additional data specific to this Code Snippet",
  28. "type": "object",
  29. "properties": {
  30. "description": {
  31. "title": "Description",
  32. "description": "Code snippet description",
  33. "type": "string"
  34. },
  35. "tags": {
  36. "title": "Tags",
  37. "description": "Tags for categorizing snippets",
  38. "type": "array",
  39. "uniqueItems": true,
  40. "items": {
  41. "minLength": 1,
  42. "pattern": "^[^ \t]+([ \t]+[^ \t]+)*$"
  43. },
  44. "uihints": {
  45. "ui:field": "tags"
  46. }
  47. },
  48. "language": {
  49. "title": "Language",
  50. "description": "Code snippet implementation language",
  51. "type": "string",
  52. "uihints": {
  53. "ui:field": "dropdown",
  54. "default_choices": ["Python", "Java", "R", "Scala", "Markdown"],
  55. "category": "Source"
  56. },
  57. "minLength": 1
  58. },
  59. "code": {
  60. "title": "Code",
  61. "description": "Code snippet code lines",
  62. "type": "array",
  63. "items": {
  64. "type": "string"
  65. },
  66. "uihints": {
  67. "ui:field": "code",
  68. "category": "Source"
  69. }
  70. }
  71. },
  72. "required": ["language", "code"]
  73. }
  74. },
  75. "required": ["schema_name", "display_name", "metadata"]
  76. }