Skip to content

Commit

Permalink
update spec according to latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Oct 1, 2024
1 parent 6dfa677 commit cdb4098
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 55 deletions.
2 changes: 1 addition & 1 deletion code/go/pkg/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func TestValidateFile(t *testing.T) {
},
},
"bad_knowledge_base": {
"kibana/knowledge_base_entry/foo/manifest.yml",
"index_data/foo/manifest.yml",
[]string{
`field (root): index is required`,
`field (root): Additional property unknown is not allowed`,
Expand Down
69 changes: 69 additions & 0 deletions spec/content/index_data/manifest.spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
##
## Describes the specification for a Kibana knowledge base entry's manifest.yml file
##
spec:
type: object
additionalProperties: false
properties:
type:
type: string
description: >
Type of the index data.
enum:
- knowledge_base_entry
description:
description: A description of what the index data provides
type: string

# Conditional properties.
title: true
index: true
retrieval: true
allOf:
- if:
properties:
type:
const: knowledge_base_entry
required:
- type
then:
properties:
title:
description: The title of the knowledge base entry as used by the knowledge base
type: string
index:
type: object
additionalProperties: false
properties:
system:
description: Specify whether the index should be system-managed or not
type: boolean
required:
- system
retrieval:
type: object
additionalProperties: false
properties:
syntactic_fields:
description: List of fields that should be used for syntactic search during retrieval.
type: array
items:
type: string
semantic_fields:
description: List of fields that should be used for semantic search during retrieval.
type: array
items:
type: string
required:
- syntactic_fields
- semantic_fields
required:
- index
- retrieval
else:
not:
required:
- index
- retrieval
required:
- type
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ spec:
additionalContents: false
totalContentsLimit: 50
contents:
- description: Folder containing a single knowledge base entry definition
- description: Folder containing a single index data definition
type: folder
pattern: '^[a-z0-9_]+[a-z0-9]$'
required: true
additionalContents: false
contents:
- description: A knowledge base entry's manifest file
- description: An index data manifest file
type: file
contentMediaType: "application/x-yaml"
sizeLimit: 2MB
name: "manifest.yml"
required: true
$ref: "./manifest.spec.yml"
- description: Folder containing field definitions for the knowledge base index
- description: Folder containing field definitions for the index
type: folder
name: fields
required: true
$ref: "../../../integration/data_stream/fields/spec.yml"
- description: Folder containing the knowledge base content files
$ref: "../../integration/data_stream/fields/spec.yml"
- description: Folder containing content files
type: folder
name: content
required: true
additionalContents: false
contents:
- description: A knowledge base entry's content file
- description: An index data's content file
type: file
sizeLimit: 20MB
contentMediaType: "application/x-ndjson"
Expand Down
43 changes: 0 additions & 43 deletions spec/content/kibana/knowledge_base_entry/manifest.spec.yml

This file was deleted.

5 changes: 0 additions & 5 deletions spec/content/kibana/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ spec:
pattern: '^{PACKAGE_NAME}-.+\.json$'
forbiddenPatterns:
- '^.+-(ecs|ECS)\.json$' # ECS suffix is forbidden
- description: Folder containing Kibana knowledge base entries
type: folder
name: knowledge_base_entry
required: false
$ref: "./knowledge_base_entry/spec.yml"
5 changes: 5 additions & 0 deletions spec/content/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ spec:
name: kibana
required: false
$ref: "./kibana/spec.yml"
- description: Folder containing Index data assets used by the package
type: folder
name: index_data
required: false
$ref: "./index_data/spec.yml"
- description: Configuration file to process the results returned from the package validation. This file is just for package validation and it should be ignored when installing or using the package.
type: file
contentMediaType: "application/x-yaml"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
type: knowledge_base_entry
title: foo
description: >
Knowledge base entry containing all the foo-related documentation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
type: knowledge_base_entry
title: foo
description: >
Knowledge base entry containing all the foo-related documentation
Expand Down

0 comments on commit cdb4098

Please sign in to comment.