Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:18
    fatihozdil commented #10637
  • 08:44

    wing328 on gh-pages

    Deploy website version based on… (compare)

  • 08:07

    wing328 on master

    update .RBuildIgnore (#12383) (compare)

  • 08:07

    wing328 on fix-rbuildignore

    (compare)

  • 08:07
    wing328 closed #12383
  • 07:58
    wing328 edited #12383
  • 07:57
    wing328 edited #12383
  • 07:54
    wing328 edited #12383
  • 07:41
    Andy2003 commented #11841
  • 07:35
    wing328 edited #12383
  • 07:34
    wing328 labeled #12383
  • 07:34
    wing328 milestoned #12383
  • 07:34
    wing328 labeled #12383
  • 07:29
    wing328 opened #12383
  • 07:13

    wing328 on fix-rbuildignore

    update .RBuildIgnore (compare)

  • 06:59
    vinkenfl edited #12382
  • 06:54
    vinkenfl edited #12382
  • 06:50
    vinkenfl edited #12382
  • 06:48
    vinkenfl labeled #12382
  • 06:48
    vinkenfl opened #12382
William Cheng
@wing328
Please give it a try and help us spread the awesome work of this community
John Wang
@grokify

We’re not planning on allowing non-Mustache templates shipped with oag until we have significant improvments on architecture. Namely, we’ve discussed a testable object instance/interface which is passed to templates rather than a Map<String, Object> with an undefined structure. We’re also looking to separate template logic from generation logic so we don’t need to have a method in a base type that requires knowledge of the template engine in order to monkey patch it’s compiler.

Thanks for the update. Are these changes being planned for 5.0?

GazEdge
@GazEdge
hey - im looking for a dev workflow/process to use swagger with js frontend - any decent blog posts anyone can recommend?
YishTish
@YishTish
@GazEdge - I worked on a project where we used codegen to generate server-side and client-side code as a boilerplate
the front-end was Angular
and back-end was JS
I'm working now on generating a NodeJS codebase for OpenAPI 3
GazEdge
@GazEdge
@YishTish yeah that’s pretty much my exact use case - js backend and vue.js front. Trying to work out how I can use the OpenAPI spec to create boilerplate for front and backend, as well as supporting any testing. Was hoping there may be some nice blog post series on it. Don’t have the bandwidth to work it out from scratch.
YishTish
@YishTish
@GazEdge - I don't know which output languages are available. Once you have the openapi-generator working on your computer (there are many ways to get it working, PM me if you need a walkthrough of that), you can type openapi-generator and get a list of available outputs. Then, run openapi-generator generate -i {{path to your openapi.yaml/json file}} -l {{language you want to generate, based on the list retrieved earlier}} -o {{directory where the generated code should be written}}. If all goes well, you should have all you need to start your project. Go through the files that were generated and get a feel of your environment. It should be pretty self-explanatory.
I'm working on a nodejs-express generator. Still work in progress. If you want to see what I've done so far, please let me know.
Michal Foksa
@MichalFoksa
Hellou,
I have a following openapi definition, it is a fragment got by -DdebugOpenAPI. I would like to know how to access x-summary and x-description field in mustache template?
[main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: openapi-yaml (documentation)
[main] INFO  o.o.codegen.DefaultGenerator - Generator 'openapi-yaml' is considered stable.
{
  "openapi" : "3.0.0",
  "info" : {
    "title" : "My Microservice API",
    "description" : "......",
    "termsOfService" : "http://sam.adidas.com/ts",
    "license" : {
      "name" : "Proprietary",

    },
    "version" : "1.2.0"
  },
  "servers" : [ {....
  } ],
  "paths" : {
    "/users" : {
      "x-summary" : "Users Collection",
      "x-description" : "Retrieve user infomation"
      "get" : {
        "tags" : [ "users" ],
        "summary" : "find",
        "description" : ...",
        "operationId" : "findUsers",
        "parameters" : [ {...} ],
        "responses" : {....},
      }
Is it even accessible ?
Stefan Dresselhaus
@Drezil
@GazEdge if you want great mock-servers you should use the haskell-backend... :)
We have some mocking laying around here - and it even gets easier with deriving via .. so in about 5min-1h you can have a full generated json-mock-server up & running.. even with domain-specific data..
I think i have to write a blogpost or so about that .. :/
@Fjolnir-Dvorak did some work on that with me .. ;)
Jim Schubert
@jimschubert
@Drezil feel free to contribute a blog post (website/blog) ;)
William Cheng
@wing328
@MichalFoksa can you try {{vendorExtensions.x-summary}} inside {{#operation}} ... {{/operation}} ?
Michal Foksa
@MichalFoksa
@wing328 Thank you for hint, but ... these extension attributes are on path level (one level above operation)
@wing328 Woudl it make sense to add vendorExtension also to that level ?
Jérémie Bresson
@jmini
Does it work if you put them under operation?
William Cheng
@wing328
@MichalFoksa right, I see your point. we may need to update the code to handle that as I don't recall adding vendor extension support to the path level
Michal Foksa
@MichalFoksa
@jmini They are supposed to describe the path - without operation
Jérémie Bresson
@jmini
If yes, I think we should copy all the path from a vendor specific extension from path to each operation (because in the codegen layer for the template, there is no distinction anymore between path and operation)
we do this already if you define a parameter in "path".
Then you have them in each of the operation defined under this path.
Michal Foksa
@MichalFoksa
Right - there is only operation, I remember now. I think I can circumvent the issue now. Put the extensions into operation and render them on path level - maybe.

@jimschubert

I think we should copy all the path from a vendor specific extension from path to each operation

Do you think it makes sense in the grand scheme of OpenAPI generator?

Michal Foksa
@MichalFoksa
@wing328 @jmini Thank you - I have workaround-ed the issue by moving the extensions on operation level
William Cheng
@wing328
:+1:
parrotcar00
@parrotcar00
@wing328 @jimschubert Is there a good-practice workflow when using openapi generation with javascript? For example, when using it in Java spring, the open api generator maven plugin makes it very easy. One just has to run maven compile and all of your generated files are updated according to your openapi.yaml file. Is there anything like that for javascript or will one have to run the update process manually each time for openapi.yaml file update?
Jim Schubert
@jimschubert
@parrotcar00 if you're using node, you can use the npm module: https://github.com/OpenAPITools/openapi-generator-cli. This is just a wrapper around the Java artifact, but you can create automation in your project pretty easily
parrotcar00
@parrotcar00
Do you keep your generated code outside git repo for javascript?
William Cheng
@wing328
@parrotcar00 you may also publish the auto-generated JS SDK Github repo, e.g. https://github.com/wing328/petstore-js.
Slavek Kabrda
@bkabrda
@cbornet hey, if you have some time to spare, could you please take a look again at OpenAPITools/openapi-generator#3474 ? a simple thumbsup/thumbsdown to let me know if I should start doing the modifications on the other library templates and regenerating samples
Christophe Bornet
@cbornet
Yes. I'll have a look. Could you show a sample of generated code ?
Slavek Kabrda
@bkabrda
sure, I'll share it in the PR
Richard Whitehouse
@richardwhiuk
I'm looking at adding callback support to the Rust Server generator. Does anyone know if any of the other generators have good support for callbacks?
Fjolnir-Dvorak
@Fjolnir-Dvorak
hmm, I am wondering. The project has a checkstyle file. Is that file to be used? At the moment it is broken (LeftCurly has no child property " <property name="maxLineLength" value="100"/>". After I repaired that locally I ran checkstyle and the result was horrific...
The file DefaultCodegen.java has 352 style violations on its own...
makes me wondering. Should the eclipse formatter config file be used or is that one historic, too?
Fjolnir-Dvorak
@Fjolnir-Dvorak
And another question. Did anyone tried to delete the samples folder and to regenerate it? After fixing the typescript-fetch scripts which are copying files without creating the directories and ignoring meta-codegen.sh (something there is broken, too, if I am trying to regenerate all sample after executing "rm -rf samples") I got about 9920 deleted files which are no longer generated anymore...
It could also be that I understand the whole project totally wrong though. But how else shall I regenerate the golden files if I made a change which would result in a file rename which I will do with the fix of case sensitive reserved word escaping
Jim Schubert
@jimschubert
Things under samples include unit tests and pom.xml files which allow us to compile and execute some supported outputs as part of our CI. You can't just delete and recreate the directory. ~10k files sounds like a node_modules directory, maybe? I'd suggest deleting only the files you expect to no longer be generated within the generator you're modifying.
Fjolnir-Dvorak
@Fjolnir-Dvorak
I saw one zero too much. I just needed to repair typescript and copy the file which were missing in meta-codegen to CI/samples and the script ensure worked again. That were only 1800 files, so it is not nearly as bad
I did not check yet if the file ensure-up-to-date.sh does what it should do
all other languages did copy their test pom.xml files from CI/samples into samples, so that worked just fine
Is it correct that OCaml is not tested by ensure-up-to-date.sh?
Fjolnir-Dvorak
@Fjolnir-Dvorak
well, that is not so easy since I modified every generator since I patched a DefaultCodegen "bug"
If what I did was wrong it is easy to fix for me since I separated those changes in different branches / commits. I assume a rebase is possible on a pull request
Fjolnir-Dvorak
@Fjolnir-Dvorak
Would it be possible to distinguish generated from manual supplied but still needed files? At the moment the files are generated in the same folder where files are lying which were added manually. That does make a well tested change nearly impossible since there is no way to distinguish those files
Jim Schubert
@jimschubert
We could add manually modified files to each ignore file, but that doesn't solve the delete/recreate unless all generators have the extra files copied from the staging directory.
Slavek Kabrda
@bkabrda
@cbornet hey, so I added the example to https://github.com/OpenAPITools/openapi-generator/pull/3474#issuecomment-516772779 - feel free to take a look and comment
Dennis Kliban
@dkliban
@wing328 Thanks for merging the faraday PR. I actually have another commit that I put together last night for handling all the TLS related options.