-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Investigations] - Add timeline api codegen #187172
Conversation
@@ -25,6 +25,8 @@ | |||
{{~else~}} | |||
.merge({{> zod_schema_item }}) | |||
{{~/if~}} | |||
{{~#if ../nullable}}.nullable(){{/if~}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to update based on how nullable: true
interacts with the $ref. Reference Issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelolo24 is this something you consider a blocker for this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I updated this, so it was more of a note. Updated the text from Need
=> Needed
as it was done :)
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
/ci |
/ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rule management changes lgtm
@michaelolo24 I'm getting a bunch of linter errors:
Which config did you use when you ran spectral? I used the ones linked from the docs: https://github.com/elastic/elastic-openapi/blob/main/.spectral.yaml |
@@ -39,9 +39,9 @@ paths: | |||
type: object | |||
properties: | |||
getOneTimeline: | |||
oneOf: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janmonschke this is why the handlebars template needed to be updated. The old pattern here wasn't valid in the 3.0.0 schema. We'll need to change it if we update it if we ever change our schema
|
||
export type PinnedEvent = z.infer<typeof PinnedEvent>; | ||
export const PinnedEvent = z.object({ | ||
columns: ColumnHeaderResult.optional(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here
Closing as the necessary changes were ported here |
Summary
Epic: https://github.com/elastic/security-team/issues/9400
Introduce automatic zod schema generation of api's based on open api spec.
Testing:
yarn openapi:generate