Insomnia Format v5#8209
Conversation
cb41723 to
b24bbe8
Compare
b24bbe8 to
2ec7d17
Compare
| "yaml-source-map": "^2.1.1" | ||
| "yaml-source-map": "^2.1.1", | ||
| "zod": "^3.23.8", | ||
| "zod-to-json-schema": "^3.23.3" |
There was a problem hiding this comment.
It seems that zod-to-json-schema is not used.
|
|
||
| const apiSpecSchema = z.object({ | ||
| type: z.literal('spec.insomnia.rest/5.0'), | ||
| meta: MetaSchema.optional(), |
There was a problem hiding this comment.
Can use zod extend method to remove duplicate codes.
| resources.push(requestGroup); | ||
|
|
||
| walkCollection(item.children, requestGroup._id); | ||
| } else if ('method' in item) { |
There was a problem hiding this comment.
I think that we need a type field to identity what entity it is.
| function getCollectionFromResources(resources: (Request | RequestGroup | WebSocketRequest | GrpcRequest)[], parentId: string): Extract<InsomniaFile, { type: 'collection.insomnia.rest/5.0' }>['collection'] { | ||
| const collection: Extract<InsomniaFile, { type: 'collection.insomnia.rest/5.0' }>['collection'] = []; | ||
|
|
||
| resources.filter(resource => resource.parentId === parentId).forEach(resource => { |
There was a problem hiding this comment.
Can build the tree in O(n) time.
d9a32a4 to
6124ada
Compare
a8e67bf to
dceb1c3
Compare
767dadc to
4bb0640
Compare
|
I think we should leave some breadcrumbs here about what The new schema looks a little more human readable than the older version. I think this PR should list future work. Examples might include:
|
|
If theres anything you can do make the parsing code any simpler it would be welcome, and perhaps a comment in the import ingestion code indicating the work that still needs to be done to untangle the brute force import mechanism. Both can be scoped out too. |
0d4b434 to
3fa7745
Compare
3fa7745 to
3ecf3f2
Compare
22a8b8d to
91fb97a
Compare
Exploring the new v5 format:
schema.tsto something better e.g.v5-schema-parser.tsfuture work:
Closes INS-4397