code-snippet.json 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. "$schema": "https://raw.githubusercontent.com/elyra-ai/elyra/master/elyra/metadata/schemas/meta-schema.json",
  3. "$id": "https://raw.githubusercontent.com/elyra-ai/elyra/master/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/v3.8.0/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. "allOf": [
  42. { "minLength": 1 },
  43. { "pattern": "^[^ \t]+" },
  44. { "pattern": "[^ \t]+$" }
  45. ]
  46. },
  47. "uihints": {
  48. "field_type": "tags"
  49. }
  50. },
  51. "language": {
  52. "title": "Language",
  53. "description": "Code snippet implementation language",
  54. "type": "string",
  55. "uihints": {
  56. "field_type": "dropdown",
  57. "default_choices": ["Python", "Java", "R", "Scala", "Markdown"],
  58. "category": "Source"
  59. },
  60. "minLength": 1
  61. },
  62. "code": {
  63. "title": "Code",
  64. "description": "Code snippet code lines",
  65. "type": "array",
  66. "uihints": {
  67. "field_type": "code",
  68. "category": "Source"
  69. }
  70. }
  71. },
  72. "required": ["language", "code"]
  73. }
  74. },
  75. "required": ["schema_name", "display_name", "metadata"]
  76. }