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

Generate code that keeps swagger spec as a string instead of a []byte #856

Merged
merged 2 commits into from Jan 11, 2017

Conversation

vburenin
Copy link
Member

@vburenin vburenin commented Jan 9, 2017

embeded_spec.go file contains swagger spec as an array of bytes that is not readable and not really diffable in case of the original swagger spec change. This PR addresses this by representing swagger spec as a string.

…rray. This should drastically reduce diff size for projects which embed generated swagger code as a part of their code.
a := &asset{bytes: bytes, info: info}
return a, nil
}

var _templatesSwagger_json_embedGotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\x91\xdd\x4a\xc3\x30\x18\x86\xcf\x73\x15\x2f\x65\xc2\x06\xda\x9d\x0b\x3b\x10\xf4\x60\x82\x3a\x9c\x37\x90\x35\x5f\xd3\xb8\xe6\x4b\xcd\x4f\xc7\x28\xb9\x77\xe9\x7e\xc4\xee\x2c\x21\xcf\xf7\x24\xef\x9b\x4e\x56\x7b\xa9\x09\xc3\x80\xf2\x69\xb3\xde\x5c\xb6\x39\x0b\xb1\x5c\xe2\xab\x31\x01\xb5\x69\x09\x07\x19\xa0\x89\xc9\xcb\x48\x0a\xbb\x23\x62\x43\x08\x07\xa9\x35\x79\x44\xe7\xda\x72\xe4\x5f\x94\x89\x86\x35\xe2\xdf\x9c\x35\xba\x89\xe8\xbc\xeb\x09\x75\x8a\x27\x55\x43\x8c\xa3\x4b\xf0\xf4\xe0\x13\x4f\x4c\xd7\x2b\x50\x39\x6b\x25\x2b\x21\x8c\xed\x9c\x8f\x98\x0b\xa0\x20\xae\x9c\x32\xac\x97\xdf\xc1\x71\x21\x04\xc6\x67\x7b\xc9\x9a\x50\x3e\x53\x2d\x53\x1b\xd7\x27\x3c\x20\xe7\x61\x40\xe7\x0d\xc7\x1a\xc5\xdd\x4f\x81\x32\xe7\x33\x4f\xac\x70\x5d\x9f\x67\x67\x7b\x3a\xde\x63\xd6\xcb\x36\x11\x1e\x57\x28\x27\x92\xf1\x14\x39\xe3\xc6\x77\xc1\x6f\xac\x8b\x53\x6d\xdb\x73\x9a\xd7\xed\xc7\x3b\xc8\xee\x48\x29\x52\xe8\xc9\x07\xe3\x18\xae\x9e\x24\x56\xae\x4a\x96\x38\x22\x05\x52\x90\xf1\x5a\xc1\x88\x46\x63\x49\xf4\xd2\x4f\x84\x63\xf6\xf2\x53\x1e\xde\x28\x04\xa9\x49\x88\x3a\x71\x05\xc3\x26\xce\x17\x18\x04\x30\xa1\x57\xb7\xfc\x7c\xfc\xe9\xff\x44\xce\x0b\x91\xc5\x6f\x00\x00\x00\xff\xff\xad\x5b\x47\xd4\x08\x02\x00\x00")
var _templatesSwagger_json_embedGotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\x91\xcd\x8a\xdb\x30\x14\x85\xf7\x7a\x8a\x83\x49\xc1\x86\xd6\xd9\x17\xb2\x28\xb4\x8b\x14\xda\x86\x66\x76\xc3\x40\x14\xeb\x5a\xd6\xc4\x96\x3c\xd2\x95\x83\x31\x7a\xf7\xc1\xf9\x19\xc6\xd9\x49\xe8\xbb\x9f\x74\x8e\x7a\x59\x9d\xa4\x26\x4c\x13\xca\x1f\xbb\xed\xee\xb6\x4d\x49\x88\xf5\x1a\x4f\x8d\x09\xa8\x4d\x4b\x38\xcb\x00\x4d\x96\xbc\x64\x52\x38\x8e\xe0\x86\x10\xce\x52\x6b\xf2\x60\xe7\xda\x72\xe6\x7f\x29\xc3\xc6\x6a\xf0\xc7\x5c\x67\x74\xc3\xe8\xbd\x1b\x08\x75\xe4\x8b\xaa\x21\x8b\xd1\x45\x78\xfa\xe6\xa3\x5d\x98\xee\x57\xa0\x72\x5d\x27\xad\x12\xc2\x74\xbd\xf3\x8c\x5c\x00\x19\xd9\xca\x29\x63\xf5\xfa\x35\x38\x9b\x09\x81\xf9\xd9\x5e\x5a\x4d\x28\x7f\x52\x2d\x63\xcb\xdb\x0b\x1e\x90\xd2\x34\xa1\xf7\xc6\x72\x8d\xec\xcb\x5b\x86\x32\xa5\x2b\x4f\x56\xe1\xbe\xbe\xce\xae\x4e\x34\x7e\xc5\x6a\x90\x6d\x24\x7c\xdf\xa0\x5c\x48\xe6\x53\xa4\x84\x07\xdf\x0d\x7f\xb0\x16\x97\xda\xf6\xd7\x34\xbf\xf7\xff\xfe\x82\xba\x23\x29\x45\x0a\x03\xf9\x60\x9c\x85\xab\x17\x89\x95\xab\x62\x47\x96\x11\x03\x29\x48\xbe\x57\x30\xa3\x6c\x3a\x12\x83\xf4\x0b\xe1\x9c\xbd\xfc\x2f\xcf\x7f\x28\x04\xa9\x49\x88\x3a\xda\x0a\xc6\x1a\xce\x0b\x4c\x02\x58\xd0\x9b\x47\x3e\x7f\x7e\x39\x8e\x4c\xf9\x61\xfe\xf1\xcf\x64\x4a\x87\xa2\x10\x49\xbc\x07\x00\x00\xff\xff\xc5\x8f\x42\x71\x12\x02\x00\x00")

Choose a reason for hiding this comment

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

don't use underscores in Go names; var _templatesSwagger_json_embedGotmpl should be _templatesSwaggerJSONEmbedGotmpl

@codecov-io
Copy link

codecov-io commented Jan 10, 2017

Current coverage is 69.32% (diff: 97.36%)

Merging #856 into master will increase coverage by 0.04%

@@             master       #856   diff @@
==========================================
  Files            21         21          
  Lines          5864       5872     +8   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           4063       4071     +8   
  Misses         1388       1388          
  Partials        413        413          

Powered by Codecov. Last update e78fe7a...4e18c64

@sflxn
Copy link
Contributor

sflxn commented Jan 10, 2017

lgtm

@vburenin
Copy link
Member Author

@casualjim Are you around?

@GlenDC GlenDC self-requested a review January 11, 2017 04:29
@GlenDC GlenDC self-assigned this Jan 11, 2017
Copy link
Member

@GlenDC GlenDC left a comment

Choose a reason for hiding this comment

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

Looks good, thank you. Can you next time keep your commit message (headline) smaller, and put extra information as a second/third line.

@GlenDC GlenDC merged commit 3ea9c54 into master Jan 11, 2017
@casualjim casualjim deleted the textified-swagger-spec branch June 18, 2017 18:50
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

5 participants