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

support keep spec properties order #1939

Merged
merged 1 commit into from May 13, 2019
Merged

support keep spec properties order #1939

merged 1 commit into from May 13, 2019

Conversation

efi-tectonic
Copy link
Contributor

@efi-tectonic efi-tectonic commented May 9, 2019

This PR solves issue #125 (Keep object's parameters order as specified in swagger spec definition).

Before loading the spec , if argument--keep-spec-order exists , it will inject x-order attribute to each property which is equal to its position in the spec file.


This change is Reviewable

@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #1939 into master will decrease coverage by 0.07%.
The diff coverage is 60.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1939      +/-   ##
==========================================
- Coverage   80.91%   80.84%   -0.08%     
==========================================
  Files          38       38              
  Lines        7589     7627      +38     
==========================================
+ Hits         6141     6166      +25     
- Misses        965      972       +7     
- Partials      483      489       +6
Impacted Files Coverage Δ
generator/shared.go 85.38% <ø> (ø) ⬆️
cmd/swagger/commands/generate/server.go 100% <100%> (ø) ⬆️
generator/support.go 86.54% <59.45%> (-2.11%) ⬇️
generator/structs.go 75.45% <0%> (+1.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffefbd2...973077d. Read the comment docs.

@casualjim
Copy link
Member

would it be possible to add a test demonstrating this behavior?

@efi-tectonic
Copy link
Contributor Author

would it be possible to add a test demonstrating this behavior?

  1. Where should I add the test?
  2. Do you what to assert the generated go file ?

@efi-tectonic efi-tectonic reopened this May 9, 2019
@casualjim
Copy link
Member

This is used in the generation process right?
you can add the test in ./generator/model_test.go for example
I think in this case you can provide a go file with the expected result and see that the output of the render matches.

Signed-off-by: Efi-Kofler <efi.kofler@tectonic.network>
@efiko12
Copy link

efiko12 commented May 13, 2019

Am I missing tests for codecov checks ?

@casualjim
Copy link
Member

Codecov is always unhappy, it's not a required check

@casualjim casualjim merged commit 8ce1ff4 into go-swagger:master May 13, 2019
@efi-tectonic efi-tectonic deleted the 125-parameters-order branch May 14, 2019 07:20
@mayurpate
Copy link

I am using mixin tool to create a single file from multiple swagger specs. In a primary/final spec, I want to maintain the properties order. This option seems to be available only for "generate server" command.

Can we make this available for mixin command as well?

@BrendanMartin
Copy link

Can this work for generate spec as well?

@terranvigil
Copy link

Can this work for generate spec as well?

It doesn't appear to but would also like to see this happen.

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.

None yet

6 participants