feat: correct typing and rename newopenapi importer to openapi
This commit is contained in:
parent
a9bd52d154
commit
24fabc8b7b
2 changed files with 6 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import HoppRESTCollImporter from "./hopp"
|
||||
import NewOpenAPIImporter from "./newopenapi"
|
||||
import OpenAPIImporter from "./openapi"
|
||||
|
||||
export const RESTCollectionImporters = [
|
||||
HoppRESTCollImporter,
|
||||
NewOpenAPIImporter,
|
||||
OpenAPIImporter,
|
||||
] as const
|
||||
|
|
|
|||
|
|
@ -557,20 +557,20 @@ const convertPathToHoppReqs = (
|
|||
|
||||
const convertOpenApiDocToHopp = (
|
||||
doc: OpenAPI.Document
|
||||
): TE.TaskEither<never, Collection<HoppRESTRequest>> => {
|
||||
): TE.TaskEither<never, Collection<HoppRESTRequest>[]> => {
|
||||
const name = doc.info.title
|
||||
|
||||
const paths = Object.entries(doc.paths ?? {})
|
||||
.map(([pathName, pathObj]) => convertPathToHoppReqs(doc, pathName, pathObj))
|
||||
.flat()
|
||||
|
||||
return TE.of(
|
||||
return TE.of([
|
||||
makeCollection<HoppRESTRequest>({
|
||||
name,
|
||||
folders: [],
|
||||
requests: paths,
|
||||
})
|
||||
)
|
||||
}),
|
||||
])
|
||||
}
|
||||
|
||||
export default defineImporter({
|
||||
Loading…
Reference in a new issue