a-chacon / oas_rails

Generate Automatic Interactive Documentation for Your Rails API
GNU General Public License v3.0
70 stars 4 forks source link

schema response ? #34

Closed Metalzoid closed 3 months ago

Metalzoid commented 3 months ago

Hey !

I tryed to include a hash in another hash in the schema response. It's supported? I tryed directly :

[Hash] {message: String, data: {availabilities: Hash, dates: Hash} } Don't work with this.

So far, i've make this = [Hash] {message: String, data: Hash, data[availabilities]: Hash, data[dates]: Hash}

Do you think it's possible include this syntax? Thanks

a-chacon commented 3 months ago

Did you try something like: [Hash] {message: String, data: { availabilities: Array<String>, dates: Array<String>}}

I don't remember if that is supported. Is that what you need?

Response Ex:

{
  message: "ok",
  data:{
    availabilities: ["9pm", "10pm"],
    dates: ["10/20/20"]
  }
}
Metalzoid commented 3 months ago

I tryed that : # @response Availabilities founded.(200) [Hash] {message: String, data: {availabilities: Array<String>, dates: Array<String>}} And the result is : { "message": "string", "data": "string", "dates": "string" }

And my availabilities and dates are arrays of hash

a-chacon commented 3 months ago

ok! Then the feature here is to add support for deeper Hashs. Mm would you like to see the code and try to implement it? I can help you, and you told me about you are junior, maybe this can help you to improve your skills. I won’t have much time after Monday since I'm starting a new job.

If not, don't worry. Just that this will take a little more time to be resolved.

Metalzoid commented 3 months ago

Ok! It's not urgent for me 😃 I'm watching this from Monday because busy this weekend ^^