Comments (9)
p2
from autorest.powershell.
[11/11 11:21 AM] Xiaogang Ding
Hi Garrett, I notice there is a configuration called "license-header", which is used to add license header for source code generated. So I add something like "license-header: MICROSOFT_MIT_NO_VERSION" in the configuration, but it does not work. Is this function broke in autorest v3?
[11/12 12:13 AM] Garrett Serack
V2 Generators got that from the autorest.common library -- it's on my list to add that to autorest-core in v3 so that the license is available in the configuration
from autorest.powershell.
This should be implemented in autorest.core.
from autorest.powershell.
@fearthecowboy Please fix it as your earliest convenience since it blocks us from releasing to the public
from autorest.powershell.
I have added the code to autorest-core to support header text values
To use this version:
Ensure that you're on @autorest/autorest
3.0.6141
or greater:
npm install -g @autorest/autorest
and then do a --reset
and get the specific autorest-core
package version 3.0.6168
:
autorest-beta --version:3.0.6168
then you can ask for the header-text
configuration value (so when --license-header
is specified, it will return the appropriate text
from autorest.powershell.
@fearthecowboy
It still does not work. BTW, the latest core version seems to be 3.0.6158 instead of 3.0.6168. And the configuration I specify in my readme.md is license-header: MICROSOFT_MIT_NO_VERSION
from autorest.powershell.
Ensure that you're on @autorest/autorest
3.0.6141
or greater:
👀 npm install -g @autorest/autorest
(which as of this moment, will install 3.0.6146
)
the lastest version of the autorest-beta package has updates that are required in order to access pre-release versions of autorest-core.
The latest PRERELEASE version (ie, not pushed to NPM) is downloaded from https://github.com/Azure/autorest/releases in order to allow for significant regression testing before publishing.
from my sample generator
// example: do something here.
let text = "A source file\n";
const headerText = await session.getValue("header-text", "NO HEADER TEXT?");
text = text + headerText;
and when you get the value for header-text
it will be:
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
Code generated by Microsoft (R) AutoRest Code Generator.
Changes may cause incorrect behavior and will be lost if the code is regenerated.
As you can see, it's in the output:
from autorest.powershell.
My bad. I mixed up the autorest and autorest.core version. I will have a try in the autorest.powershell generator. BTW, considering to add license header is a common requirement for all generators, can we implement it in a common plugin instead that each generator will have to write the license header by itself. @fearthecowboy
from autorest.powershell.
Given that each language has a different comment style, that is virtually impossible.
from autorest.powershell.
Related Issues (20)
- Media content-type header is not being generated for input file types. HOT 3
- [Autorest] optional parameter is set to be required in VMware swagger
- Module will be created and inited many times in one session when `-Parallel` is used. HOT 2
- Monitor Metric Get-AzMetricsBatch encode name parameter twice HOT 1
- [Feature] Generate cmdlet to Add/remove elements for a complex array parameter HOT 1
- [Feature] Generate parameter description with possbile values. HOT 2
- Parameter Capability is an array, enum is the items, value should be generated HOT 2
- build-module.ps1 - The parameter 'Body' has multiple parameter types HOT 1
- Dockerfile needs updating HOT 2
- Test-Module: Import Az.Accounts should not be required HOT 3
- Infinite recursion issue when traversing object properties HOT 2
- Remove use of write-information as it pollutes information stream when loading Az-modules
- format url is invalid type when generating with autorest 3.x HOT 2
- Add support for 'operation-location' for dataplane LRO(Long Running Operations) HOT 2
- Module fails to build due to duplicate definitions HOT 2
- MG-graph Mail Forward issue HOT 1
- Module fails to build due to missing arguments HOT 8
- Parameter name is a duplicate HOT 4
- Synopsis/Description does not support newlines
- Question: Will multiple servers in openapi generate a param for selecting the server per cmdlet? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autorest.powershell.