Swagger CodeGen Multiple API Endpoints - swagger-codegen

So after using the Swagger-CodeGen, I was wondering if there was any way to exclude generating the Client Folder (with Configuration, ApiClient, ApiException, etc) since this code seems to be boilerplate and it would be duplicated when I have a multiple endpoints generated with CodeGen.
Besides from manually going to delete the client folder and remapping the namespaces in the generated Api's, is there currently a solution for this?

You can skip file generation by using the .swagger-codegen-ignore file, which works very similar to .gitignore. Here is an example:
# Swagger Codegen Ignore
# Lines beginning with a # are comments
# This should match build.sh located anywhere.
build.sh
# Matches build.sh in the root
/build.sh
# Exclude all recursively
docs/**
Ref: https://github.com/swagger-api/swagger-codegen#ignore-file-format

Related

Rapidoid custom config file is ignored

I'm very new to Rapidoid and I'm experiencing problem with initial configuration of the application. I'm using Rapidoid 5.5.5 with following Rapidoid modules defined in pom:
rapidoid-commons
rapidoid-http-server
rapidoid-web
Java 11 is used to run the application.
I've prepared a custom config-develop.yml file where I've changed value for port to use from default 8080 to 18888 and added some menu items in gui: section however when I start application none of my changes were used: generated log does not have any data about accepting/use of parameters from my file and configuration files are the files that are included into rapidoid-commons Maven artefact.
Also, the log shows that classpath used is limited to /target/classes folder (I'm using Maven as build tool). So, these are my questions:
What are the rules for merging configuration information when multiple config-*.yml files are present in search path?
How I can tell Rapidoid to ignore some configuration files?
Is it possible to specify explicit name for configuration file as part of initialisation process?
I'm happy to provide additional information if this will help to find an answer to the questions above.
With best regards,
Nick

Ignoring Less files with Middleman

I have a Middleman project that includes several Less files. I think Middleman attempts to build the files but fails. I can reproduce this on a a clean install. I just initiate a project, add an empty 'test.less' within the source folder and then either build or run the server -- both fail. I get an error to the tune of: cannot load such file -- less (LoadError)
Is there a way to explicitly ignore these files?
Middleman has support for ignoring files. The docs for this are part of the dynamic pages feature.
In your config.rb you can call ignore "test.less" and this file will be ignored.
You can make this more complex by using globs or regexes e.g. ignore "*.less". See the ignore docs for more detailed information.

Dropwizard serve external images directory

I have a dropwizard API app and I want one endpoint where I can run the call and also upload and image, these images have to be saved in a directory and then served through the same application context.
Is it possible with dropwizard? I can only find static assets bundles.
There is similar question already: Can DropWizard serve assets from outside the jar file?
The above module is mentioned in the third party modules list of dropwizard. There is also official modules list. These two lists are hard to find maybe because the main documentation doesn't reference them.
There is also dropwizard-file-assets which seems new. I don't know which module will work best for your case. Both are based on dropwizard's AssetServlet
If you don't like them you could use it as example how to implement your own. I suspect that the resource caching part may not be appropriate for your use case if someone replace the same resource name with new content: https://github.com/dirkraft/dropwizard-file-assets/blob/master/src/main/java/com/github/dirkraft/dropwizard/fileassets/FileAssetServlet.java#L129-L141
Edit: This is simple project that I've made using dropwizard-configurable-assets-bundle. Follow the instructions in the README.md. I think it is doing exactly what you want: put some files in a directory somewhere on the file system (outside the project source code) and serve them if they exist.

TFS api - candidates excluded by file extension

I am trying to import a set of files into TFS using the API. The method Workspace.GetPendingChangesWithCandidates excludes files that match the globally ignored file extensions (.dll, etc). How can I get these files from the API so that I can PendAdd them?
I found an answer but I think it's a kludge. You can edit the LocalItemExclusions.config file found here:
C:\Users\%username%\appdata\local\microsoft\team foundation\4.0\configuration\versioncontrol.
Ultimately, I think the ignored files should be overridden from the API, but I can't find such an option.
It is an older question, but this may help others: Another way to get files recognized as candidates is to create a file called ".tfignore" within the workspace that enables globally filtered files again.
# Do not ignore .dll files in this folder nor in any of its sub-folders
!*.dll
More details can be found here
MSDN: Add files to the server - Customize which files are ignored by version control

Teamcity 2 configurations merge and deploy

I have two teamcity configurations one becoming my common helpers and reuseable components and my other a website which uses the common project.
I use a third configuration to publish to a test environment.
When the third configuration is run i would like it to get the artifacts from the common project and merge them with the website output and deploy. Am i asking for two much?
This ought to be pretty straightforward.
On ThirdConfig add two artifact dependencies. One whose source is CommonProject, and another whose source is WebProject. When configuring an artifact dependency it will allow you to specify which artifact files are are actually pulled from CommonProject and WebProject into ThirdConfig via the 'Artifact paths'. The artifact files can then be placed into some new folder hierarchy specific to ThirdConfig by using the 'Destination path'. These two options ought to be enough to create the directory structure that is the merging of CommonProject and WebProject. That takes care of the merge part.
The deploy is a bit more tricky. To my knowledge TeamCity does not support any sort of 'copy or upload to external location' function out of the box. For this bit you'll need to create an msbuild script (or batch file, or anything that can be run from the command line). Said script can expect the file/directory structure you've created via artifact dependencies where the root of the structure is the initial working directory of the script, and need only push these files out to your specific deploy location. That 'push' of course is going to be specific to your environment. Ftp, unc share, etc.