package org.etsi.mts.tdl.openapi2tdl.next.doc;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.parameters.Parameter;

public class OpenAPIVisitor {
	protected OpenAPI model;
	protected Doc content;
	
	public OpenAPIVisitor() {}
	
	public OpenAPIVisitor init(OpenAPI model, Doc content) {
		this.model = model;
		this.content = content;
		return this;
	}
	
	void preamble(OpenAPI model) { }

	void path(String path) { }

	void operation(String path, String method, Operation op) { }

	void postamble(OpenAPI model) { }
	
	String getParameterType(Parameter param) {
		Schema<?> schema = param.getSchema();
		return schema != null ? schema.getType() : "unknown";
	}


}