generate functionMon, 03 Apr 2023

write me a javascript function that parses swagger JSON file and returns all POST endpoints as array of objects with url property and parse the object shape from the #/definitions part and add that as a property named 'obj'

function getPostEndpoints(swagger){ return swagger.paths .filter(p => .map(p => { return { url: p.path, obj: swagger.definitions[[0].schema.$ref.replace('#/definitions/', '')] } }) }

Generate More

Questions about programming?Chat with your personal AI assistant