Fork me on GitHub
#aws
<
2019-05-16
>
mj_langford15:05:56

AWS JSON files are swagger2.0 right?

ghadi15:05:17

I don't think so

mj_langford15:05:52

Just checked, yup, swagger:

mj_langford15:05:54

--- swagger: "2.0"

mj_langford15:05:39

So OpenAPI is basically the 3.0 version of swagger...so, no, aws doesn't take open api because swagger is version 2.0 of that

mj_langford15:05:20

You can generate the large body of swagger 2.0 spec for import if you spend time getting all your URIs setup, and you also take time to get your transformations working.

mj_langford15:05:44

(We have done this on a clojure project that used a swagger-codegen generated test client)

kenny15:05:36

@mj_langford Where are you seeing the swagger: "2.0"?

mj_langford15:05:44

I went to an api I made last year about this time, went to "Stages" then picked export.

mj_langford15:05:54

They have an OpenApi3 there too

mj_langford15:05:07

openapi: "3.0.1"

mj_langford15:05:03

go to the export tab

mj_langford15:05:15

You can redploy from these files too

ghadi15:05:32

which files are you looking at @mj_langford?

mj_langford15:05:24

I don't know what that file is

mj_langford15:05:35

I use yaml, so am used to seeing comments, etc.

mj_langford15:05:49

Is that a swagger file?

ghadi15:05:14

it is not a swagger file

ghadi15:05:24

i think you are talking about something different

ghadi15:05:04

yesterday someone brought up mechanically generating clients from the metadata that AWS / GCP / Azure provide

ghadi15:05:15

AWS's aren't swagger/openapi

mj_langford15:05:30

AWS provides API files from another place, which was the JSON I believed you were speaking of

mj_langford15:05:55

https://console.aws.amazon.com/apigateway/ literally exports OpenAPI/Swagger files for apis we write

ghadi15:05:55

it's cool that APIGateway appears to export openapi/swagger though

mj_langford16:05:17

They seem to use HAL, which appears it may be way that json spec you're pointing at could be

zlrth18:05:28

this might be an easy amazonica question for y'all: i'd like to enable bucket-versioning. Here it is "Off":

c.s3> (amazonica.aws.s3/get-bucket-versioning-configuration {:bucket-name "my-bucket"})
{:status "Off"}
I try to enable it, but it wants an object, not a string:
c.s3>  (amazonica.aws.s3/set-bucket-versioning-configuration {:bucket-name "my-bucket" :versioning-configuration "Enabled"} )
IllegalArgumentException No coercion is available to turn Enabled into an object of type class com.amazonaws.services.s3.model.BucketVersioningConfiguration  amazonica.core/coerce-value (core.clj:399)

zlrth18:05:41

BucketVersioningConfiguration isn't mentioned in Amazonica, so i'm unsure how to set-bucket-versioning-configuration without cloning Amazonica, adding the importing of BucketVersioningConfiguration myself, and doing it inside a repl under Amazonica, instead of in my project. i suspect i'm missing something

holyjak10:05:56

doesn't Amazonica use magic and reflection to turn Clj data into the expected AWS classes? What if you pass in a clojure map with keys corresponding to the bean's properties?

zlrth19:05:37

i did all those things, and they worked fwiw.