Stéphane asked a question on the PR but as it was already closed, I wanted to 
reproduce it here for visibility and to see if other community members had 
something to add:

Stéphane:

good stuff. Quick question, what do you think of NiFi automating the build and 
release of API clients in various language, vs me just maintaining it in my own 
repos?

My reply:

I don't think that's something we should do at this time. The NiFi build is 
already long enough (10 - 20 minutes on commodity hardware depending on 
multithreading, tests, and contrib-check) and I don't think many people need 
this functionality, much less in multiple languages, and I don't know how we 
would determine the default languages -- maybe just Java to start as that's 
what the codebase is written in?

If you want to submit a PR for a custom profile that builds the API clients, I 
wouldn't object to that as long as it was disabled by default. Not sure what 
others' feelings are.

Andy LoPresto
alopre...@apache.org
alopresto.apa...@gmail.com
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Oct 13, 2016, at 5:13 PM, Matt Gilman <matt.c.gil...@gmail.com> wrote:
> 
> Thanks for submitting the PR Stephane! I see that Andy has already stated 
> that he's reviewing. Thanks Andy!
> 
> On Thu, Oct 13, 2016 at 7:42 PM, Stéphane Maarek <stephane.maa...@gmail.com 
> <mailto:stephane.maa...@gmail.com>> wrote:
> Investigated some more, open a JIRA issue, closed it via 
> https://github.com/apache/nifi/pull/1135 
> <https://github.com/apache/nifi/pull/1135>
> 
> On Fri, Oct 14, 2016 at 9:47 AM Stéphane Maarek <stephane.maa...@gmail.com 
> <mailto:stephane.maa...@gmail.com>> wrote:
> Hi,
> 
> Thanks it helps ! Good to know there is already a java client I could use. 
> Nonetheless I think it would be extremely nice to use the swagger codegen 
> project to generate additionally sdks, I don't mind creating a github project 
> of my own to maintain these.
> 
> I gave it a go and it gave me a bunch of errors, see  
> https://github.com/swagger-api/swagger-codegen/issues/3976 
> <https://github.com/swagger-api/swagger-codegen/issues/3976>
> 
> I went to https://editor.swagger.io/ <https://editor.swagger.io/> , uploaded 
> the swagger.json file and apparently the swagger.json specs for many (if not 
> all) delete calls are having wrong specs, see below. Do you think that's 
> worth opening a JIRA?
> 
> 
> Swagger Error
> Not a valid parameter definition
> Jump to line 344
>  <>Details
>  Object <>
> code: "ONE_OF_MISSING" <>
>  params: Array [0] <>
> message: "Not a valid parameter definition" <>
>  path: Array [5] <>
> 0: "paths" <>
> 1: "/connections/{id}" <>
> 2: "delete" <>
> 3: "parameters" <>
> 4: "0" <>
> schemaId: "http://swagger.io/v2/schema.json#"; <>
>  inner: Array [2] <>
>  0: Object <>
> code: "ONE_OF_MISSING" <>
>  params: Array [0] <>
> message: "Data does not match any schemas from 'oneOf'" <>
>  path: Array [5] <>
>  inner: Array [2] <>
>  0: Object <>
> code: "OBJECT_MISSING_REQUIRED_PROPERTY" <>
>  params: Array [1] <>
> 0: "schema" <>
> message: "Missing required property: schema" <>
>  path: Array [0] <>
>  1: Object <>
> code: "ONE_OF_MISSING" <>
>  params: Array [0] <>
> message: "Data does not match any schemas from 'oneOf'" <>
>  path: Array [0] <>
>  inner: Array [4] <>
>  0: Object <>
> code: "ENUM_MISMATCH" <>
>  params: Array [1] <>
> message: "No enum match for: ref" <>
>  path: Array [1] <>
>  1: Object <>
> code: "ENUM_MISMATCH" <>
>  params: Array [1] <>
> message: "No enum match for: ref" <>
>  path: Array [1] <>
>  2: Object <>
> code: "ENUM_MISMATCH" <>
>  params: Array [1] <>
> message: "No enum match for: ref" <>
>  path: Array [1] <>
>  3: Object <>
> code: "ENUM_MISMATCH" <>
>  params: Array [1] <>
> 0: "ref" <>
> message: "No enum match for: ref" <>
>  path: Array [1] <>
> 0: "type" <>
>  1: Object <>
> code: "OBJECT_MISSING_REQUIRED_PROPERTY" <>
>  params: Array [1] <>
> 0: "$ref" <>
> message: "Missing required property: $ref" <>
>  path: Array [5] <>
> 0: "paths" <>
> 1: "/connections/{id}" <>
> 2: "delete" <>
> 3: "parameters" <>
> 4: "0" <>
> level: 900 <>
> type: "Swagger Error" <>
> description: "Not a valid parameter definition" <>
> lineNumber: 344 <>
> 
> On Thu, Oct 13, 2016 at 11:43 PM Matt Gilman <matt.c.gil...@gmail.com 
> <mailto:matt.c.gil...@gmail.com>> wrote:
> Stephane,
> 
> Yes, you are correct that Apache NiFi uses swagger. However, we are only 
> using it for keeping the documentation in sync. We use a maven plugin that 
> inspects the swagger annotations and generates a swagger.json. The 
> swagger.json is generated to nifi-web-api/target/swagger-ui/swagger.json at 
> build time. Subsequently, the swagger.json is run through a handlebars 
> template to generate the REST API docs.
> 
> We provide a client library at
> <dependency>
>     <groupId>org.apache.nifi</groupId>
>     <artifactId>nifi-client-dto</artifactId>
>     <version>1.0.0</version>
> </dependency>
> Examples of its usage can be seen in our access control integration tests [1].
> 
> Let me know if you have any other questions. Thanks!
> 
> Matt
> 
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessorAccessControl.java
>  
> <https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITProcessorAccessControl.java>
> 
> On Wed, Oct 12, 2016 at 10:53 PM, Stéphane Maarek <stephane.maa...@gmail.com 
> <mailto:stephane.maa...@gmail.com>> wrote:
> Hi,
> 
> It seems possible to create an API client for any language using this project:
> https://github.com/swagger-api/swagger-codegen 
> <https://github.com/swagger-api/swagger-codegen>
> 
> It needs the swagger.json file. I know it should be generated at build time, 
> but where can I find it?
> 
> Beyond that, would it be useful to extract that file, version control it, and 
> maybe automatically generate API sdks for many languages using the project 
> above? Would help tremendously
> 
> Cheers
> Stephane
> 
> 

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to