Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add x-ms-enum's default to SwaggerObject. #9

Merged
merged 7 commits into from
Sep 21, 2017

Conversation

amarzavery
Copy link
Contributor

No description provided.

@msftclas
Copy link

@amarzavery,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@amarzavery
Copy link
Contributor Author

fixes Azure/autorest#1449

@amarzavery
Copy link
Contributor Author

The last commit is expected to fail as it is dependent on a change made in autorest.common in this PR Azure/autorest.common#11

@@ -56,9 +56,11 @@ public virtual IModelType BuildServiceType(string serviceTypeName)
type.XmlProperties = (SwaggerObject as Schema)?.Xml;
type.Format = SwaggerObject.Format;
var xMsEnum = SwaggerObject.Extensions.GetValue<JToken>(Core.Model.XmsExtensions.Enum.Name);
if ((SwaggerObject.Enum != null || xMsEnum != null) && type.KnownPrimaryType == KnownPrimaryType.String && !(IsSwaggerObjectConstant(SwaggerObject)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this check type.KnownPrimaryType == KnownPrimaryType.String. Since we want to support enums of different primary types.

@amarzavery amarzavery merged commit cfabb17 into Azure:master Sep 21, 2017
@olydis
Copy link
Contributor

olydis commented Sep 21, 2017

release job

error

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

> dotnet-2.0.0@1.2.0 postinstall C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler\node_modules\dotnet-2.0.0
> node -e "try { fs.statSync('./dist/app.js') ; require('./dist/app.js')} catch (e){}"

Recording package path for platform-specific runtime: C:\Users\jobader\.net\2.0.0\node_modules\dotnet-2.0.0-win\

> dotnet-sdk-2.0.0@1.2.0 postinstall C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler\node_modules\dotnet-sdk-2.0.0
> node -e "try { fs.statSync('./dist/app.js') ; require('./dist/app.js')} catch (e){}"

Recording package path for platform-specific runtime: C:\Users\jobader\.net\2.0.0\node_modules\dotnet-sdk-2.0.0-win\

> @microsoft.azure/autorest.modeler@1.9.8 prepare C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler
> gulp build

[16:00:56] Using gulpfile ~\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler\gulpfile.js
[16:00:56] Starting 'init'...
[16:00:56] Finished 'init' after 7.71 ms
[16:00:56] Starting 'clear-cache-on-force'...
[16:00:56] Finished 'clear-cache-on-force' after 41 μs
[16:00:56] Starting 'restore'...
           C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler :: dotnet restore C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler\src\autorest.modeler.csproj /nologo
           C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler :: dotnet restore C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler\test\autorest.modeler.test.csproj /nologo
[16:01:06] Finished 'restore' after 9.6 s
[16:01:06] Starting 'build/dotnet'...
           C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler :: dotnet build -c Debug C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler/autorest.modeler.sln /nologo /clp:NoSummary
           C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler :: dotnet publish -c Debug C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler/src/ --output C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler/src//bin/netcoreapp2.0 /nologo /clp:NoSummary 
[16:01:22] Finished 'build/dotnet' after 16 s
[16:01:22] Starting 'build'...
Building project in C:\Users\jobader\AppData\Local\Temp\PUBLISHi4lav\9_20170921T230031\autorest.modeler
[16:01:22] Finished 'build' after 167 μs
npm notice created a lockfile as package-lock.json. You should commit this file.
added 287 packages in 48.956s
npm ERR! missing script: publish-preview

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jobader\AppData\Roaming\npm-cache\_logs\2017-09-21T23_01_23_950Z-debug.log

olydis added a commit that referenced this pull request Sep 22, 2017
fearthecowboy pushed a commit that referenced this pull request Sep 22, 2017
* Revert "Pub (#10)"

This reverts commit 2ed83ac.

* Revert "Add x-ms-enum's default to SwaggerObject. (#9)"

This reverts commit cfabb17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants