[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-25 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339342#comment-16339342
 ] 

ASF subversion and git services commented on NIFI-4801:
---

Commit c4e2ac7cda45591d357519217687aa7979bae8fb in nifi's branch 
refs/heads/master from [~kdoran]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=c4e2ac7 ]

NIFI-4801 Fixes Swagger spec for uploadTemplate. This closes #2428


> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339345#comment-16339345
 ] 

ASF GitHub Bot commented on NIFI-4801:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/2428


> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339344#comment-16339344
 ] 

ASF GitHub Bot commented on NIFI-4801:
--

Github user mcgilman commented on the issue:

https://github.com/apache/nifi/pull/2428
  
Thanks @kevdoran! This has been merged to master.


> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339299#comment-16339299
 ] 

ASF GitHub Bot commented on NIFI-4801:
--

Github user mcgilman commented on the issue:

https://github.com/apache/nifi/pull/2428
  
Will review...


> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread Kevin Doran (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335990#comment-16335990
 ] 

Kevin Doran commented on NIFI-4801:
---

Thanks [~chaffelson]. I've opened a PR to merge this to NiFi master 

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread Daniel Chaffelson (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335986#comment-16335986
 ] 

Daniel Chaffelson commented on NIFI-4801:
-

[~kdoran] [~mcgilman]
Changes tested and I confirm it now works with NiPyAPI as per previous versions 
- I have integrated these modifications and pushed them to NiPyApi if you want 
to check for yourselves.

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335954#comment-16335954
 ] 

ASF GitHub Bot commented on NIFI-4801:
--

Github user kevdoran commented on the issue:

https://github.com/apache/nifi/pull/2428
  
The following command produces [this new 
output](https://github.com/apache/nifi/files/1656609/swagger.json.txt) as part 
of the build:

mvn -T 2C clean install -Pcontrib-check -pl :nifi-web-api





> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335950#comment-16335950
 ] 

ASF GitHub Bot commented on NIFI-4801:
--

GitHub user kevdoran opened a pull request:

https://github.com/apache/nifi/pull/2428

NIFI-4801 Fixes Swagger spec for uploadTemplate

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [ ] Does your PR title start with NIFI- where  is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.

- [ ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kevdoran/nifi NIFI-4801

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/2428.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2428


commit 19f78a6ee63a7e833893c009978b3f9b22b2b35e
Author: Kevin Doran 
Date:   2018-01-23T14:59:58Z

NIFI-4801 Fixes Swagger spec for uploadTemplate




> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Fix For: 1.6.0
>
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread Kevin Doran (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335887#comment-16335887
 ] 

Kevin Doran commented on NIFI-4801:
---

[~chaffelson] thanks for offering to test the code generation. I've attached 
the swagger.json that is produced from my branch: 
[https://github.com/kevdoran/nifi/tree/NIFI-4801] 

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0, 1.6.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
> Attachments: corrected-swagger.json
>
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread Kevin Doran (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335878#comment-16335878
 ] 

Kevin Doran commented on NIFI-4801:
---

Yep, that's correct [~mcgilman]. The spec changing was an unintentional side 
effect of changes across the versions of the swagger annotations that we are 
using. There was no Java code change. 

[~chaffelson] - Using the new version of the swagger library we are on, I'm 
able to tweak the annoation I added to make the output more consistent with 
what it was in version <=1.4, which I agree is desirable. Here is what I have 
now:

{noformat}
  "parameters" : [ {
"name" : "id",
"in" : "path",
"description" : "The process group id.",
"required" : true,
"type" : "string"
  }, {
"name" : "template",
"in" : "formData",
"description" : "The binary content of the template file being uploaded.",
"required" : true,
"type" : "file"
  } ],
{noformat}

The new version differs from <=1.4 only in that the template parameter is now 
labeled required, but it really always has been required and prior to this was 
just incorrectly marked as optional.

By the way, given that a lot of discussion has happened on this ticket, I've 
closed NIFI-4796 as a duplicate and my PR will reference this ticket. I will 
leave the tickets linked for informational purposes. cc 
[~sbouc...@infovista.com].

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0, 1.6.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread Daniel Chaffelson (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335859#comment-16335859
 ] 

Daniel Chaffelson commented on NIFI-4801:
-

[~mcgilman] Fair enough, but can we return to the 'formData' approach from 
previous versions instead of moving to a 'body' approach?

I'm a fan of consistency.

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0, 1.6.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-23 Thread Matt Gilman (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335856#comment-16335856
 ] 

Matt Gilman commented on NIFI-4801:
---

[~chaffelson] 

I don't believe the endpoint changed. The difference appears to be from 
upgrading to a newer version of swagger that was introduced in this Jira [1].

[1] https://issues.apache.org/jira/browse/NIFI-4328

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0, 1.6.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-22 Thread Daniel Chaffelson (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16335387#comment-16335387
 ] 

Daniel Chaffelson commented on NIFI-4801:
-

In 1.2/1.3/1.4 we had:
{code:java}
"parameters" : [ {
"name" : "id",
"in" : "path",
"description" : "The process group id.",
"required" : true,
"type" : "string"
}, {
"name" : "template",
"in" : "formData",
"required" : false,
"type" : "file"
} ]
{code}
Would it not make more sense to revert to the previous method than introducing 
a new method? Unless of course this is to bring it into consistency with other 
methods in the platform, it would make more sense to me to revert.

I can easily test the resulting swagger.json, just let me know which version is 
preferred or provide me a sample compile.

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0, 1.6.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-22 Thread Matt Gilman (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16334891#comment-16334891
 ] 

Matt Gilman commented on NIFI-4801:
---

[~kdoran] The change makes sense to me, but I'll allow someone who is actually 
consuming these APIs through that spec to confirm it's accuracy.

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0, 1.6.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-22 Thread Kevin Doran (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16334880#comment-16334880
 ] 

Kevin Doran commented on NIFI-4801:
---

[~mcgilman] I added this annotation to 
{{ProcessGroupResource.uploadTemplate(...)}}:

{code}
@ApiImplicitParams(
value = {
@ApiImplicitParam(
name = "body",
value = "The binary content of the template file being uploaded",
required = true,
dataType = "java.io.File",
paramType = "body")
}
)
{code}

which changes the swagger.json output to:

{noformat}
...
"/process-groups/{id}/templates/upload" : {
  "post" : {
"tags" : [ "process-groups" ],
"summary" : "Uploads a template",
"description" : "",
"operationId" : "uploadTemplate",
"consumes" : [ "multipart/form-data" ],
"produces" : [ "application/xml" ],
"parameters" : [ {
  "name" : "id",
  "in" : "path",
  "description" : "The process group id.",
  "required" : true,
  "type" : "string"
}, {
  "in" : "body",
  "name" : "body",
  "description" : "The binary content of the template file being uploaded",
  "required" : true,
  "schema" : {
"type" : "file"
  }
} ],
"responses" : {
  "200" : {
"description" : "successful operation",
"schema" : {
  "$ref" : "#/definitions/TemplateEntity"
}
  },
  "400" : {
"description" : "NiFi was unable to complete the request because it was 
invalid. The request should not be retried without modification."
  },
  "401" : {
"description" : "Client could not be authenticated."
  },
  "403" : {
"description" : "Client is not authorized to make this request."
  },
  "409" : {
"description" : "The request was valid but NiFi was not in the 
appropriate state to process it. Retrying the same request later may be 
successful."
  }
},
"security" : [ {
  "Write - /process-groups/{uuid}" : [ ]
} ]
  }
},
...
{noformat}

[~chaffelson] - does that output look correct to you? any quick way to test it 
will, if used as an input, procedurally generate the correct python code?

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0, 1.6.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Major
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-22 Thread Daniel Chaffelson (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16334583#comment-16334583
 ] 

Daniel Chaffelson commented on NIFI-4801:
-

[~mcgilman] Yeah this duplicates that issue, though perhaps with a little more 
detail and test code/documentation to look at. Up to you which to move forward.

I would also suggest that you look at the way Export Template works to make 
sure it's producing a consistent experience perhaps?

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Assignee: Kevin Doran
>Priority: Minor
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-4801) Rest-api swagger definition produces non-functional template import in Python

2018-01-22 Thread Matt Gilman (JIRA)

[ 
https://issues.apache.org/jira/browse/NIFI-4801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16334319#comment-16334319
 ] 

Matt Gilman commented on NIFI-4801:
---

[~chaffelson] Is this the same issue as 
https://issues.apache.org/jira/browse/NIFI-4796

> Rest-api swagger definition produces non-functional template import in Python
> -
>
> Key: NIFI-4801
> URL: https://issues.apache.org/jira/browse/NIFI-4801
> Project: Apache NiFi
>  Issue Type: Bug
>  Components: Core Framework
>Affects Versions: 1.5.0
> Environment: Python 2.7/3.6
>Reporter: Daniel Chaffelson
>Priority: Minor
>
> The swagger.json produced when compiling NiFi-1.5.0 results in a 
> ProcessgroupsApi().upload_template function that only accepts the id of the 
> Process Group to receive the template, and no option to specify the template 
> itself.
> It would appear that the underlying API call expects the template to be the 
> body of the request, but the produced function does not allow it to be 
> specified. This is changed from NiFi-1.2.0 where a  'template' keyword 
> argument was included.
> It may also be related to how the TemplatesApi().export_template function 
> used to produce a TemplateDTO and now produces a string. 
> I am unsure in which version since 1.2.0 this changed, it may not 
> specifically be just 1.5.0 code.
> An example of the procedurally generated code can be found at:
> [https://github.com/Chaffelson/nifi-python-swagger-client/blob/master/swagger_client/apis/processgroups_api.py]
> And documentation at:
> [http://nifi-python-swagger-client.readthedocs.io/en/latest/ProcessgroupsApi/#upload_template]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)