Thanks for the input. I used an online tool to convert the V3 to V2 Swagger. I do get the error message below when I try to save the connector based on that definition.
Specified swagger has the following errors: 'Definition is not valid. Error: 'Error : paths/~1method~1logout/get/responses/200/schema/default : The 'default' value is of type 'String', but should match the given type 'Object'. ## Error : paths/~1resource~1{DocType}/get/parameters/1/default : The 'default' value is of type 'String', but should match the given type 'Array'. '
swagger: '2.0'
info:
version: '0.0.1'
title: Frappe / ERPNext API
description: >
Unofficial documentation of the [Frappe](https://frappe.io) / [ERPNext](https://erpnext.org) API.
contact:
email: raffael@alyf.de
name: Raffael Meyer
url: https://alyf.de
host: demo.erpnext.com
basePath: /api
securityDefinitions:
tokenAuth:
type: apiKey
description: >-
Get your API keys at User -> Api Access -> Generate Keys.
"headers = {'Authorization': 'token <api_key>:<api_secret>'}"
name: Authorization
in: header
basicAuth:
type: basic
description: >
Get your API keys at User -> Api Access -> Generate Keys.
username = api_key; password = api_secret
[More info](https://frappe.io/docs/user/en/guides/integration/token_based_auth)
oAuth2:
type: oauth2
description: "This API uses OAuth 2 with the authorization code flow. \n[More info]https://frappe.io/docs/user/en/guides/integration/using_oauth)\n"
flow: accessCode
authorizationUrl: https://demo.erpnext.com/api/method/frappe.integrations.oauth2.authorize
tokenUrl: https://demo.erpnext.com/api/method/frappe.integrations.oauth2.get_token
scopes:
all: Same permissions as the user who created the oAuth client
schemes:
- https
consumes:
- application/json
produces:
- application/json
paths:
/method/login:
post:
description: Authenticate yourself
summary: login
tags:
- Naive Authentication
operationId: login
deprecated: false
produces:
- application/json
- text/html
consumes:
- application/x-www-form-urlencoded
parameters:
- name: usr
in: query
required: false
type: string
description: Your username
- name: pwd
in: query
required: false
type: string
description: Your password
- name: Content-Type
in: header
required: false
enum:
- application/x-www-form-urlencoded
type: string
description: ''
- name: data
in: formData
required: false
type: string
description: ''
responses:
'200':
description: Login successful
schema:
$ref: '#/definitions/MethodLoginResponse'
headers: {}
'401':
description: oneOf(Incomplete login details, Incorrect password, User disabled or missing)
schema:
$ref: '#/definitions/MethodLogin401Error1'
headers: {}
/method/logout:
get:
description: Logout from current session
summary: Logout from current session
tags:
- Naive Authentication
operationId: Logoutfromcurrentsession
deprecated: false
produces:
- application/json
parameters: []
responses:
'200':
description: Logged out.
schema:
type: object
default: ''
headers: {}
/method/frappe.auth.get_logged_user:
get:
description: Get the currently logged in user
summary: authGetLoggedUser
tags:
- Naive Authentication
operationId: authGetLoggedUser
deprecated: false
produces:
- application/json
- text/html
parameters: []
responses:
'200':
description: search results matching criteria
schema:
$ref: '#/definitions/MethodFrappeAuthGetLoggedUserResponse'
headers: {}
'401':
description: Not permitted
schema:
$ref: '#/definitions/MethodFrappeAuthGetLoggedUser401Error1'
headers: {}
/method/version:
get:
description: Get the version of the app
summary: Get the version of the app
operationId: Gettheversionoftheapp
deprecated: false
produces:
- application/json
parameters: []
responses:
'200':
description: Successful
schema:
$ref: '#/definitions/MethodVersionResponse'
headers: {}
/resource/{DocType}:
post:
description: Create a new document
summary: Create a new document
operationId: Createanewdocument
deprecated: false
produces:
- application/json
- text/html
consumes:
- application/x-www-form-urlencoded
parameters:
- name: DocType
in: path
required: true
type: string
description: The DocType you'd like to receive. For example, Customer.
- name: Content-Type
in: header
required: false
enum:
- application/x-www-form-urlencoded
type: string
description: ''
- name: data
in: formData
required: false
type: string
description: ''
responses:
'200':
description: Document created
schema:
$ref: '#/definitions/ResourceResponse'
headers: {}
'403':
description: Insufficient Permission
schema:
$ref: '#/definitions/Resource403Error1'
headers: {}
get:
description: Returns a list of documents of the given type
summary: Get a list of documents
operationId: Getalistofdocuments
deprecated: false
produces:
- application/json
parameters:
- name: DocType
in: path
required: true
type: string
description: "The DocType you'd like to receive. For example Customer, Supplier, \nEmployee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, etc."
- name: fields
in: query
required: false
default: >-
[
"name"
]
type: array
items:
type: string
description: "By default, only the \"name\" field is included in the listing, to add more fields, \nyou can pass the fields param to GET request. For example, fields=[\"name\",\"country\"]"
- name: filters
in: query
required: false
type: array
items:
type: array
items:
type: string
description: >-
You can filter the listing using sql conditions by passing them as the filters GET param.
Each condition is an array of the format, [{doctype}, {field}, {operator}, {value}].
For example, filters=[["Customer", "country", "=", "India"]]
- name: limit_page_length
in: query
required: false
default: 20
type: integer
format: int32
description: "By default, all listings are returned paginated. With this parameter you can change the \npage size (how many items are teturned at once)."
- name: limit_start
in: query
required: false
default: 0
type: integer
format: int32
description: "To request successive pages, pass a multiple of your limit_page_length as limit_start. \nFor Example, to request the second page, pass limit_start as 20."
responses:
'200':
description: "Found requested DocType. By default, only the \"name\" field is included in the listing, \nto add more fields, you can pass the fields param to GET request."
schema:
$ref: '#/definitions/DocList'
headers: {}
/resource/{DocType}/{DocumentName}:
get:
description: Get a document by it's name, for example EMP001 of DocType Employee.
summary: Get a specific document
operationId: Getaspecificdocument
deprecated: false
produces:
- application/json
parameters:
- name: DocType
in: path
required: true
type: string
description: "The DocType you'd like to receive. For example Customer, Supplier, \nEmployee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, etc."
- name: DocumentName
in: path
required: true
type: string
description: The name (ID) of the document you'd like to receive. For example EMP001 (of type Employee).
responses:
'200':
description: Found requested document
schema:
$ref: '#/definitions/ResourceResponse'
headers: {}
put:
description: TBD
summary: Update a specific document
operationId: Updateaspecificdocument
deprecated: false
produces:
- application/json
parameters:
- name: DocType
in: path
required: true
type: string
description: "The DocType you'd like to update. For example Customer, Supplier, \nEmployee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, etc."
- name: DocumentName
in: path
required: true
type: string
description: The name (ID) of the document you'd like to update. For example EMP001 (of type Employee).
responses:
'200':
description: Updated specified document
schema:
$ref: '#/definitions/ResourceResponse'
headers: {}
delete:
description: TBD
summary: Delete a specific document
operationId: Deleteaspecificdocument
deprecated: false
produces:
- application/json
parameters:
- name: DocType
in: path
required: true
type: string
description: "The type of the document you'd like to delete. For example Customer, Supplier, \nEmployee, Account, Lead, Company, Sales Invoice, Purchase Invoice, Stock Entry, etc."
- name: DocumentName
in: path
required: true
type: string
description: The name (ID) of the document you'd like to delete. For example EMP001 (of type Employee).
responses:
'202':
description: Deleted specified document
schema:
$ref: '#/definitions/ResourceResponse3'
headers: {}
definitions:
DocType:
title: DocType
type: object
properties:
name:
type: string
modified_by:
type: string
creation:
type: string
modified:
type: string
doctype:
type: string
owner:
type: string
docstatus:
type: integer
format: int32
DocList:
title: DocList
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/DocType'
MethodFrappeAuthGetLoggedUser401Error1:
title: MethodFrappeAuthGetLoggedUser401Error1
type: object
properties:
exc:
example: Traceback (most recent call last) ...
type: string
_server_messages:
example:
- message: Not permitted
type: string
MethodFrappeAuthGetLoggedUserResponse:
title: MethodFrappeAuthGetLoggedUserResponse
type: object
properties:
message:
example: demo@erpnext.com
type: string
MethodLogin401Error1:
title: MethodLogin401Error1
type: object
properties:
exc:
example: Traceback (most recent call last) ...
type: string
message:
example: Incorrect password
type: string
MethodLoginResponse:
title: MethodLoginResponse
type: object
properties:
full_name:
example: Administrator
type: string
message:
example: Logged in
type: string
home_page:
example: /desk
type: string
MethodVersionResponse:
title: MethodVersionResponse
type: object
properties:
message:
example: 10.1.36
type: string
Resource403Error1:
title: Resource403Error1
type: object
properties:
exc:
example: Traceback (most recent call last) ...
type: string
_error_message:
example: Insufficient Permission for {DocType}
type: string
ResourceResponse:
title: ResourceResponse
type: object
properties:
data:
$ref: '#/definitions/DocType'
ResourceResponse3:
title: ResourceResponse3
type: object
properties:
message:
type: string
security: []
tags:
- name: Naive Authentication
description: If you are developing something serious, you may want to use oAuth2.