text stringlengths 0 1.49k |
|---|
[637.80 --> 644.92] So it's wasteful to spend a lot of time building these little example things just to poke at |
[644.92 --> 645.72] the API. |
[646.98 --> 647.08] Yeah. |
[647.40 --> 656.90] So Ivan, describe in a bit more detail, how do you go from the Go code to having that beautiful |
[656.90 --> 661.42] HTML API documentation? |
[661.42 --> 662.80] And what do you need? |
[662.88 --> 667.20] Do you need to boot up a server to serve that HTML? |
[667.50 --> 668.20] How does it work? |
[669.20 --> 669.40] Okay. |
[669.62 --> 670.20] So, yeah. |
[670.44 --> 681.00] So what you need is you download the binary, a Swagger binary, and you add some vocabulary |
[681.00 --> 682.54] in your document comment. |
[682.80 --> 686.62] So the way, because there are two main use cases here, right? |
[686.62 --> 693.30] So generating a specification from an existing code base, which I suspect, but I really have |
[693.30 --> 694.48] no way of tracking that. |
[694.92 --> 701.18] I suspect most people use something like JIN or whatever, and they just want to get a |
[701.18 --> 704.08] Swagger JSON file come out. |
[704.88 --> 710.40] In that case, what I've tried to do is define a number of documentation comments that also |
[710.40 --> 715.94] look good when you just do Godoc to describe what is in your API. |
[715.94 --> 721.46] So you document your routes with some of the expectations that are required for Swagger. |
[721.68 --> 725.56] You document your models, and you just write doc comments, basically. |
[726.36 --> 733.30] And then you run Swagger generates spec, and you point it to your main package, and it will |
[733.30 --> 737.88] reflect over your application and generate the Swagger JSON file. |
[738.38 --> 743.46] From there, you take the Swagger binary, and you do Swagger serve, and point it to the |
[743.46 --> 747.62] spec document that you just created, and it will serve up an HTML UI for you. |
[748.62 --> 757.24] So if I want to have a system where I can share this documentation with my entire team, should |
[757.24 --> 760.98] I have them download the Swagger? |
[760.98 --> 762.56] Swagger, what's the best way? |
[762.70 --> 764.14] That's what I'm trying to think. |
[764.68 --> 767.28] Should they download the binary and run? |
[767.64 --> 771.40] For example, I can have the Swagger document station file on GitHub somewhere. |
[771.84 --> 775.34] Maybe together with my project, they download that, they run it themselves. |
[775.76 --> 782.66] Or should I put up a server to run so we can all access online? |
[782.66 --> 789.70] So you don't have to download the server necessarily, as long as you publish the Swagger JSON somewhere. |
[790.32 --> 794.02] Yeah, not a server, the binary, the Swagger binary, right? |
[794.12 --> 794.52] The tool. |
[795.40 --> 800.82] Yeah, once you have a Swagger JSON document, you don't really need the binary anymore. |
[802.18 --> 804.30] Oh, because it's generated already. |
[804.56 --> 805.78] Yeah, you have the Swagger JSON. |
[805.78 --> 822.28] So if you push the Swagger JSON onto like a gist or something, then people could use the raw URL and use it with petstore.swagger.io to leverage the UI that is published there and just paste that in the address box there. |
[822.38 --> 824.64] And then it will serve you the UI there. |
[825.44 --> 834.56] If I have it on a GitHub repo, would I get the nice interaction? |
[835.78 --> 838.34] No, no, you need to have your API running. |
[838.48 --> 839.98] Yeah, you need to have your API running. |
[839.98 --> 853.44] So the best way to do it is what was originally specified or part of the specification was it would always be at the root slash Swagger JSON of your API. |
[853.62 --> 858.04] So if you run your server, you have to make sure that it serves the Swagger spec somewhere. |
[858.70 --> 859.14] I see. |
[859.14 --> 872.20] You get it with your API so that the host and the base path and so on are all filled in correctly so that any client who can look at it knows how to use your API because it has the URL where you can find it. |
[872.70 --> 877.82] And at the same time, it has all of the documentation or all of the expectations filled out. |
[878.68 --> 878.94] Gotcha. |
[879.44 --> 879.96] Thank you. |
[879.96 --> 909.94] Thank you. |
[909.96 --> 939.94] Thank you. |
[939.96 --> 969.94] Thank you. |
[969.96 --> 971.96] Thank you. |
[971.96 --> 975.96] Thank you. |
[999.96 --> 1002.74] trying libraries to do JSON schema. |
[1002.98 --> 1006.22] We didn't go, but most of them had some problems, |
[1006.40 --> 1008.28] and I tried to submit some PRs. |
[1008.32 --> 1010.66] They never got accepted, so I decided to fork |
[1010.66 --> 1013.18] and just make it work the way I wanted it to work. |
[1014.76 --> 1016.60] And so, yeah, it's in many places. |
[1018.80 --> 1021.46] Last week, there was a project, |
[1022.46 --> 1025.26] Mecca.io or something, I can post it later on |
[1025.26 --> 1026.28] in the Slack channel, |
[1026.28 --> 1031.24] that generates a whole series of tests for your API. |
[1031.46 --> 1034.44] So it will then try to first test your API |
[1034.44 --> 1037.56] when you generate it based on the Swagger spec. |
[1038.38 --> 1039.18] Oh, that's nice. |
[1039.86 --> 1042.42] Yeah, I agree. |
[1044.38 --> 1050.08] So now you're at VMware working on the PKS team? |
[1050.56 --> 1050.78] Yeah. |
[1051.26 --> 1054.80] I think it's kind of amusing that half of the tech industry |
[1054.80 --> 1058.70] is employed now in some way, shape, or form around Kubernetes. |
[1059.70 --> 1059.98] Yeah. |
[1060.18 --> 1061.78] Well, when I joined VMware, |
[1061.90 --> 1063.92] I started making noise about Kubernetes, |
[1064.72 --> 1066.28] and after several false starts, |
[1066.38 --> 1068.14] we landed on doing this PKS thing. |
[1070.08 --> 1074.36] Kubernetes has been this interesting evolution, right? |
[1074.44 --> 1078.68] It's like, let's do OpenStack, but not OpenStack. |
[1078.76 --> 1079.76] Let's make it a lot better, |
[1080.08 --> 1081.30] make it our hand containers. |
[1081.30 --> 1087.22] I do think it solves a problem that most people have at the moment. |
[1087.40 --> 1092.46] So it's been a very interesting process to see that grow up, that project. |
[1093.20 --> 1095.74] Yeah, it's really, really exploded. |
[1096.52 --> 1101.86] And I think that it was a really awesome initiative to begin with. |
[1101.86 --> 1106.66] But a common conversation I have with people with adoption of Kubernetes |
[1106.66 --> 1112.28] is just maintenance of the infrastructure in itself is work. |
[1112.98 --> 1115.36] So people will be quick to implement it, |
[1115.42 --> 1120.04] but then they find they're struggling with having to maintain Kubernetes |
[1120.04 --> 1124.38] and all the little failure scenarios and things like that, |
[1124.38 --> 1126.56] and not their business logic. |
[1126.82 --> 1129.48] And then they end up with a team that just supports Kubernetes. |
[1130.14 --> 1133.52] And that's why I like all these amazing product offerings |
[1133.52 --> 1136.12] for managed Kubernetes, PKS, |
[1136.68 --> 1138.88] and Microsoft's new AKS, |
[1139.14 --> 1139.84] and GKE. |
[1141.14 --> 1142.04] Wait, what's... |
[1142.04 --> 1144.04] GCE. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.