Insomnia import and export

Official document address: https://support.insomnia.rest/article/172-importing-and-exporting-data

Insomnia supports importing a wide variety of file types. Currently, supported formats are Insomnia , Postman v2 , HAR , OpenAPI, Swagger, WSDL  , and Curl .

 file-7wiHFaxg6T.png (1602×690)

export format specification

Note:   https://github.com/kong/insomnia/tree/develop/packages/insomnia-importers  has a support for migrating older export versions to latest, as well as supporting external formats such as HAR , PostmanSwaggerOpenAPI and curl . If you'd like to help contribute new content, please feel free to submit a pull request to Insomnia's insomnia-importers package.

root export object

{
  "_type" : "导出" ,
  "__export_format" : 3 ,
  "__export_date" : "2017-01-10T23:15:55.928Z" ,
  "__export_source" : "insomnia.desktop.app:v4.0.13" ,
  “资源”: [{
    "_type" : "请求" ,
    “网址”:“https://google.com”
  }, {
    “……”:“……”
  }]
}
  • _type: Currently the only possible values ​​are export
  • __export_format: Specifies the data schema to export
  • __export_data: ISO timestamp of export time
  • resources: all exported resources (see below for resource types)

common resource attribute

{
  "_type" : "资源类型" ,
  "_id" : "type_111" ,
  "parentId" : "type_4567" ,
  “创建”:1484090000356,
  “修改”:1484090000356,
  “……”:“……”
}
  • _type: See the following sections for possible resource types
  • _id: Represents the Id of the resource
  • parentID: the resource ID of the parent object (folder or workspace)
  • created: When creating a resource
  • modified: The time the resource was last modified

special resource ID

__WORKSPACE_ID__

ID mapped to the currently active workspace

__BASE_ENVIRONMENT_ID__

The ID of the base environment mapped to the active workspace

__<NAME>_<NUMBER>__

 Any value matching this pattern will deterministically generate a new ID on import.

[{
  "_type" : "工作区" ,
  “_id”:“__WORKSPACE_1__”
}, {
  "_type" : "请求" ,
  "_id" : "__REQUEST_1__" ,
  “parentId”:“__WORKSPACE_1__”
}]

Resource Type

These are the possible resource types that can be imported/exported.

Resource Type:workspace

{
  "_type" : "工作区" ,
  "_id" : "__WORKSPACE_ID__" ,
  "parentId" : null ,
  “创建”:1484090000356,
  “修改”:1484090000356,
  "name" : "我的 API 项目" ,
  "description" : "这是 https://api.insomnia.rest/ 的 API"
}

  • name: workspace name
  • description: A plain text description of the workspace

Resource Type:environment

{
  "_type" : "环境" ,
  "_id" : "__ENVIRONMENT_1__" ,
  "parentId" : "__WORKSPACE_ID__" ,
  "name" : "开发" ,
  “数据”:{
    "base_url" : "https://insomnia.rest" ,
    "user_id" : "user_123" ,
    “……”:“……”
  }
}

  • name: environment name
  • data{}: User-defined data representing the environment

Resource Type:request_group

{
  "_type" : "request_group" ,
  "_id" : "__FOLDER_2__" ,
  "name" : "新建文件夹" ,
  "parentId" : "__FOLDER_1__" ,
  “创建”:1484090000356,
  “修改”:1484090000356,
  “元排序键”:1,
  “环境”:{
    "url" : "{
   
   { base_url }}/my/awesome/path" ,
    “……”:“……”
  }
}

  • name: Folder name
  • metaSortKey: sort priority relative to its sibling
  • environment: user-defined environment override data

Resource Type:request

{
  "_type" : "请求" ,
  "_id" : "__REQUEST_1__" ,
  "parentId" : "__FOLDER_2__" ,
  “创建”:1484090000356,
  “修改”:1484090000356,
  "name" : "我的请求" ,
  "方法" : "POST" ,
  "url" : "https://insomnia.rest/foo/bar" ,
  “身体”:{
    "mimeType" : "multipart/form-data" ,
    "文本" : "" ,
    “参数”:[{
      “类型”:“文件”,
      "name" : "my_file" ,
      "fileName" : "/home/amy/hello.txt" ,
      “禁用”:假
    }, {
      “类型”:“文本”,
      "name" : "foo" ,
      “价值”:“酒吧”,
      “禁用”:假
    }, {
      “类型”:“文本”,
      "name" : "blah" ,
      “价值”:“酒吧”,
      “禁用”:真
    }]
  },
  “参数”:[{
    "name" : "限制" ,
    “价值”:“10”,
    “禁用”:假
  }],
  “标题”:[{
    "name" : "内容类型" ,
    "value" : "application/json" ,
    “禁用”:假
  }],
  “身份验证”:{
    "用户名" : "用户" ,
    “密码”:“通过”
  },
  “元排序键”:10
}

 

Guess you like

Origin blog.csdn.net/weixin_39118023/article/details/118787554